diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-29 16:37:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-29 16:37:38 +0200 |
commit | 51913ccf136aff6b01b19fd13078b726cde15d6f (patch) | |
tree | 28eada9709b17d29bc03d54dcc44606b65b406e1 /libxsde/xsde/cxx/parser | |
parent | 71e026399d644c3e46aff5cab5e92c8ac56f0c79 (diff) |
Use binary search to check for string enumerations
Diffstat (limited to 'libxsde/xsde/cxx/parser')
-rw-r--r-- | libxsde/xsde/cxx/parser/validating/string-common.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libxsde/xsde/cxx/parser/validating/string-common.cxx b/libxsde/xsde/cxx/parser/validating/string-common.cxx index e226766..328f2ce 100644 --- a/libxsde/xsde/cxx/parser/validating/string-common.cxx +++ b/libxsde/xsde/cxx/parser/validating/string-common.cxx @@ -3,7 +3,7 @@ // copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -#include <string.h> // strcmp +#include <xsde/cxx/string-search.hxx> #include <xsde/cxx/parser/validating/string-common.hxx> namespace xsde @@ -40,13 +40,7 @@ namespace xsde if (f.enum_count_ != 0) { - size_t i = 0; - - for (; i < f.enum_count_; ++i) - { - if (strcmp (s, f.enum_[i]) == 0) - break; - } + size_t i = search (f.enum_, f.enum_count_, s); if (i == f.enum_count_) { |