From 09c2491896971ef361e3ca339175e625c98d406e Mon Sep 17 00:00:00 2001 From: Bernhard Amann Date: Mon, 24 Feb 2014 08:13:38 -0800 Subject: [PATCH] Remove unused and potentially unsafe function ListVal::IncludedInString --- src/Val.cc | 17 ----------------- src/Val.h | 7 ------- 2 files changed, 24 deletions(-) diff --git a/src/Val.cc b/src/Val.cc index e072914afb..8c60f4c490 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -1171,23 +1171,6 @@ ListVal::~ListVal() Unref(type); } -const char* ListVal::IncludedInString(const char* str) const - { - if ( tag != TYPE_STRING ) - Internal("non-string list in ListVal::IncludedInString"); - - loop_over_list(vals, i) - { - const char* vs = (const char*) (vals[i]->AsString()->Bytes()); - - const char* embedded = strstr(str, vs); - if ( embedded ) - return embedded; - } - - return 0; - } - RE_Matcher* ListVal::BuildRE() const { if ( tag != TYPE_STRING ) diff --git a/src/Val.h b/src/Val.h index 33bd89c0d5..3d4141cd7a 100644 --- a/src/Val.h +++ b/src/Val.h @@ -669,13 +669,6 @@ public: Val* Index(const int n) { return vals[n]; } const Val* Index(const int n) const { return vals[n]; } - // Returns offset of where str includes one of the strings in this - // ListVal (which had better be a list of strings), nil if none. - // - // Assumes that all of the strings in the list are NUL-terminated - // and do not have any embedded NULs. - const char* IncludedInString(const char* str) const; - // Returns an RE_Matcher() that will match any string that // includes embedded within it one of the patterns listed // (as a string, e.g., "foo|bar") in this ListVal.