]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Remove dead ComponentClass::{get,set}FirstChar
authorJustin Viiret <justin.viiret@intel.com>
Sun, 8 Nov 2015 23:49:19 +0000 (10:49 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 10 Nov 2015 03:36:39 +0000 (14:36 +1100)
src/parser/ComponentClass.cpp
src/parser/ComponentClass.h
src/parser/Parser.rl

index d90d7db2e0d30861c0eed37edcac5f88356b3dcd..4570734d828dad489d5dcfb6093b627cacd589b1 100644 (file)
@@ -420,7 +420,7 @@ unique_ptr<ComponentClass> getLiteralComponentClass(unsigned char c,
 
 ComponentClass::ComponentClass(const ParseMode &mode_in)
     : m_negate(false), mode(mode_in), in_cand_range(false),
-      range_start(INVALID_UNICODE), finalized(false), firstChar('\0') {}
+      range_start(INVALID_UNICODE), finalized(false) {}
 
 ComponentClass::~ComponentClass() { }
 
index 21b512026e7b0976c3a2cdd83b268d3a99e3d6fa..ce3b49f3605c37f3db5df9ae0ce5317ab4f37982 100644 (file)
@@ -245,9 +245,6 @@ public:
 
     bool isNegated() const { return m_negate; }
 
-    void setFirstChar(char c) { firstChar = c; }
-    char getFirstChar() const { return firstChar; }
-
     std::vector<PositionInfo> first() const override = 0;
     std::vector<PositionInfo> last() const override = 0;
     bool empty() const override { return false; } /* always 1 codepoint wide */
@@ -263,19 +260,13 @@ protected:
     unichar range_start;
     bool finalized;
 
-    /** Literal character at the start of this character class, e.g. '.' for
-     * the class [.abc]. Used to identify (unsupported) POSIX collating
-     * elements. */
-    char firstChar;
-
     virtual void createRange(unichar) = 0;
 
     // Protected copy ctor. Use clone instead.
     ComponentClass(const ComponentClass &other)
         : Component(other), m_negate(other.m_negate), mode(other.mode),
           in_cand_range(other.in_cand_range), range_start(other.range_start),
-          finalized(other.finalized),
-          firstChar(other.firstChar) {}
+          finalized(other.finalized) {}
 };
 
 } // namespace ue2
index 37beb7653f3cfbe29e32a8ba6b5de3ef3de45eaa..a0378dcefa01b8122ed59b8952c4bd0e419fb2ce 100644 (file)
@@ -1094,9 +1094,6 @@ unichar readUtf8CodePoint4c(const u8 *ts) {
 
               # Literal character
               (any - ']') => {
-                  if (currentCls->class_empty()) {
-                      currentCls->setFirstChar(*ts);
-                  }
                   currentCls->add(*ts);
               };