mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-16 12:57:10 +02:00
Update WIP discord and some vendors.
CPR has features disabled and PCRE is fully disabled until updated to new code.
This commit is contained in:
41
vendor/ZMQ/src/radix_tree.cpp
vendored
41
vendor/ZMQ/src/radix_tree.cpp
vendored
@@ -1,31 +1,4 @@
|
||||
/*
|
||||
Copyright (c) 2018 Contributors as noted in the AUTHORS file
|
||||
|
||||
This file is part of libzmq, the ZeroMQ core engine in C++.
|
||||
|
||||
libzmq is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License (LGPL) as published
|
||||
by the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
As a special exception, the Contributors give you permission to link
|
||||
this library with independent modules to produce an executable,
|
||||
regardless of the license terms of these independent modules, and to
|
||||
copy and distribute the resulting executable under terms of your choice,
|
||||
provided that you also meet, for each linked independent module, the
|
||||
terms and conditions of the license of that module. An independent
|
||||
module is a module which is not derived from or based on this library.
|
||||
If you modify this library, you must extend this exception to your
|
||||
version of the library.
|
||||
|
||||
libzmq is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/* SPDX-License-Identifier: MPL-2.0 */
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "macros.hpp"
|
||||
@@ -326,7 +299,7 @@ bool zmq::radix_tree_t::add (const unsigned char *key_, size_t key_size_)
|
||||
_root._data = current_node._data;
|
||||
else
|
||||
parent_node.set_node_at (edge_index, current_node);
|
||||
++_size;
|
||||
_size.add (1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -362,7 +335,7 @@ bool zmq::radix_tree_t::add (const unsigned char *key_, size_t key_size_)
|
||||
current_node.set_edge_at (0, key_node.prefix ()[0], key_node);
|
||||
current_node.set_edge_at (1, split_node.prefix ()[0], split_node);
|
||||
|
||||
++_size;
|
||||
_size.add (1);
|
||||
parent_node.set_node_at (edge_index, current_node);
|
||||
return true;
|
||||
}
|
||||
@@ -394,7 +367,7 @@ bool zmq::radix_tree_t::add (const unsigned char *key_, size_t key_size_)
|
||||
current_node.set_edge_at (0, split_node.prefix ()[0], split_node);
|
||||
current_node.set_refcount (1);
|
||||
|
||||
++_size;
|
||||
_size.add (1);
|
||||
parent_node.set_node_at (edge_index, current_node);
|
||||
return true;
|
||||
}
|
||||
@@ -402,7 +375,7 @@ bool zmq::radix_tree_t::add (const unsigned char *key_, size_t key_size_)
|
||||
zmq_assert (key_bytes_matched == key_size_);
|
||||
zmq_assert (prefix_bytes_matched == current_node.prefix_length ());
|
||||
|
||||
++_size;
|
||||
_size.add (1);
|
||||
current_node.set_refcount (current_node.refcount () + 1);
|
||||
return current_node.refcount () == 1;
|
||||
}
|
||||
@@ -424,7 +397,7 @@ bool zmq::radix_tree_t::rm (const unsigned char *key_, size_t key_size_)
|
||||
return false;
|
||||
|
||||
current_node.set_refcount (current_node.refcount () - 1);
|
||||
--_size;
|
||||
_size.sub (1);
|
||||
if (current_node.refcount () > 0)
|
||||
return false;
|
||||
|
||||
@@ -574,5 +547,5 @@ void zmq::radix_tree_t::apply (
|
||||
|
||||
size_t zmq::radix_tree_t::size () const
|
||||
{
|
||||
return _size;
|
||||
return _size.get ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user