[wesnoth-commits] [wesnoth/wesnoth] 237c9c: wml/preprocessor: Reduce code duplication in prepr...

Iris Morelle noreply at github.com
Fri Dec 4 18:13:21 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 237c9c34ddba97e176becb123d58e4be348cd3ef
      https://github.com/wesnoth/wesnoth/commit/237c9c34ddba97e176becb123d58e4be348cd3ef
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2020-12-04 (Fri, 04 Dec 2020)

  Changed paths:
    M src/serialization/preprocessor.cpp

  Log Message:
  -----------
  wml/preprocessor: Reduce code duplication in preprocessor conditionals

The code handling #if(n)def and #if(n)have is largely the same in both
the normal and the negated paths, making two code paths redundant. This
commit unifies each pair as it should have been done from the beginning.

This commit also alters the implementation of #if(n)ver very slightly so
we do a single char check instead of comparing against a whole string a
second time (we definitely don't need to compare the full thing).





More information about the Commits mailing list