zwoop commented on code in PR #12749:
URL: https://github.com/apache/trafficserver/pull/12749#discussion_r2640539374


##########
plugins/header_rewrite/parser.h:
##########
@@ -195,12 +195,22 @@ class Parser
     return _val;
   }
 
+  // Note that this consumes the modifier out of _mods.
   bool
-  mod_exist(const std::string &m) const
+  mod_exist(const std::string &m)
   {
-    return std::find(_mods.begin(), _mods.end(), m) != _mods.end();
+    auto it = std::find(_mods.begin(), _mods.end(), m);
+
+    if (it != _mods.end()) {
+      _mods.erase(it);
+      return true;
+    }
+    return false;
   }

Review Comment:
   I've renamed this function as suggested.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to