0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-14 17:58:01 +08:00

Update array.hpp (#3769)

* Update array.hpp

Problem:Calling back on an empty container causes undefined behavior.
Solution:Check with the function empty()

* Create xqcool.mq

Adds relicensing grant
This commit is contained in:
xqcool 2020-01-01 17:37:51 +08:00 committed by Luca Boccassi
parent 246cc77efc
commit 382c6d7186
2 changed files with 18 additions and 2 deletions

15
RELICENSE/xqcool.mq Normal file
View File

@ -0,0 +1,15 @@
# Permission to Relicense under MPLv2 or any other share-alike OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by xqcool
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
share-alike Open Source Initiative approved license chosen by the current
ZeroMQ BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "xqcool", with
commit author "xqcool <xuquan316@live.com>", are copyright of xqcool .
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
xqcool
2020/01/01

View File

@ -100,7 +100,8 @@ template <typename T, int ID = 0> class array_t
inline void erase (size_type index_) inline void erase (size_type index_)
{ {
if (_items.back ()) if (_items.empty ())
return;
((item_t *) _items.back ())->set_array_index ((int) index_); ((item_t *) _items.back ())->set_array_index ((int) index_);
_items[index_] = _items.back (); _items[index_] = _items.back ();
_items.pop_back (); _items.pop_back ();