Skip to content

Commit

Permalink
fix: a bug in Realloc
Browse files Browse the repository at this point in the history
  • Loading branch information
XadillaX committed Jul 21, 2022
1 parent d99ae3e commit 9d10dee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/resizable_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class ResizableBuffer {
}

inline void Realloc(size_t new_length) {
if (new_length == _real_length) {
if (new_length == _length) {
return;
} else if (new_length < _real_length) {
} else if (new_length <= _real_length) {
_length = new_length;
_byte_length = _length * sizeof(T);
return;
Expand Down

0 comments on commit 9d10dee

Please sign in to comment.