diff --git a/met/src/basic/vx_log/string_array.cc b/met/src/basic/vx_log/string_array.cc index c93d0a25b3..866c08eda8 100644 --- a/met/src/basic/vx_log/string_array.cc +++ b/met/src/basic/vx_log/string_array.cc @@ -390,13 +390,16 @@ bool StringArray::has(const std::string text) const bool found = false; bool forward = true; - mlog << Debug(9) << "In has() for Sorted=true and IgnoreCase=false: searching for text = " << text.c_str() << "\n"; + mlog << Debug(9) << "In new has() searching for text = " << text.c_str() << "\n"; if (Sorted && !IgnoreCase) { mlog << Debug(9) << " Sorted is true and IgnoreCase is false" << "\n"; found = binary_search(s.begin(), s.end(), text); + mlog << Debug(9) << " After binary_search, found = " << found << "\n"; } else { + mlog << Debug(9) << " Sorted = " << Sorted << " IgnoreCase = " << IgnoreCase << "\n"; + mlog << Debug(9) << " Calling middle has() function" << "\n"; return ( has(text, forward) ); } @@ -431,7 +434,7 @@ bool StringArray::has(const std::string text, int & index, bool forward) const bool found = false; index = -1; - mlog << Debug(9) << "In has() for Sorted=false or IgnoreCase=true: searching for text = " << text.c_str() << "\n"; + mlog << Debug(9) << "In original has() searching for text = " << text.c_str() << "\n"; if (!s.empty()) { int count; @@ -447,6 +450,7 @@ bool StringArray::has(const std::string text, int & index, bool forward) const mlog << Debug(9) << " Sorted is false, IgnoreCase is true, forward is true, lower_s (*it) = " << lower_s.c_str() << "\n"; transform(lower_s.begin(), lower_s.end(), lower_s.begin(), ::tolower); if ( lower_s == lower_text) { + mlog << Debug(9) << " found lower_text = " << lower_text.c_str() << "\n"; found = true; break; } @@ -454,6 +458,7 @@ bool StringArray::has(const std::string text, int & index, bool forward) const else { mlog << Debug(9) << " Sorted is false, IgnoreCase is false, forward is true, *it = " << (*it).c_str() << "\n"; if ( *it == text ) { + mlog << Debug(9) << " found text = " << text.c_str() << "\n"; found = true; break; } @@ -496,6 +501,8 @@ bool StringArray::has(const std::string text, int & index, bool forward) const // << " for " << text << ", found: " << (found ? "true" : "false") // << ", forward: " << (forward ? "yes" : "no") << "\n"; + mlog << Debug(9) << "\n"; + return found; }