This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new d95d6a4851 IPRangeSet::erase (#12548)
d95d6a4851 is described below
commit d95d6a48519bcf7a57006f221944ea3bd7b53a0c
Author: Brian Neradt <[email protected]>
AuthorDate: Wed Oct 8 15:03:40 2025 -0500
IPRangeSet::erase (#12548)
This adds IPRangeSet::erase to libswoc. This is in the libswoc 1.5.15
release and brings us up to date with that release. I'll do a separate
PR with the version update.
---
lib/swoc/include/swoc/IPRange.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/lib/swoc/include/swoc/IPRange.h b/lib/swoc/include/swoc/IPRange.h
index 030c03b1d8..3cc332709a 100644
--- a/lib/swoc/include/swoc/IPRange.h
+++ b/lib/swoc/include/swoc/IPRange.h
@@ -1570,6 +1570,13 @@ public:
*/
self_type &fill(swoc::IPRange const &r);
+ /** Erase addresses from the set.
+ *
+ * @param r Range of addresses to erase.
+ * @return @a this
+ */
+ self_type &erase(swoc::IPRange const &r);
+
/// @return @c true if @a addr is in the set.
bool contains(swoc::IPAddr const &addr) const;
@@ -1675,6 +1682,12 @@ IPRangeSet::fill(swoc::IPRange const &r) -> self_type & {
return *this;
}
+inline auto
+IPRangeSet::erase(swoc::IPRange const &r) -> self_type & {
+ _addrs.erase(r);
+ return *this;
+}
+
inline bool
IPRangeSet::contains(swoc::IPAddr const &addr) const {
return _addrs.find(addr) != _addrs.end();