Skip to content

Commit c909d12

Browse files
committed
Adding ability to use a custom comparator
1 parent da64d1a commit c909d12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ESPressio_ThreadSafe.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace ESPressio {
5151
public:
5252
// Constructor/Destructor
5353
Mutex(T value, std::function<void(T,T)> onChange = nullptr, std::function<bool(T,T)> onCompare = nullptr) : _value(value), _onChange((onChange)) {
54-
if (onCompare) != nullptr { _onCompare = onCompare; }
54+
!=if (onCompare != nullptr) { _onCompare = onCompare; }
5555
}
5656
// Methods
5757
T Get() {
@@ -155,7 +155,7 @@ namespace ESPressio {
155155
public:
156156
// Constructor/Destructor
157157
ReadWriteMutex(T value, std::function<void(T,T)> onChange = nullptr, std::function<bool(T,T)> onCompare = nullptr) : _value(value), _onChange((onChange)) {
158-
if (onCompare) != nullptr { _onCompare = onCompare; }
158+
!=if (onCompare != nullptr) { _onCompare = onCompare; }
159159
}
160160
// Methods
161161
T Get() {

0 commit comments

Comments
 (0)