Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nseam authored and kenorb committed Apr 25, 2024
1 parent 35ffd93 commit c3ca6da
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion DictIteratorBase.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class DictIteratorBase {
bool IsLast() {
if (!IsValid()) return true;

if (_dict PTR_DEREF GetMode() == DictModeUnknown || _dict.Size() == 0) {
if (_dict PTR_DEREF GetMode() == DictModeUnknown || _dict PTR_DEREF Size() == 0) {
return false;
}

Expand Down
12 changes: 6 additions & 6 deletions DictStruct.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ class DictStruct : public DictBase<K, V> {
else
slot = GetSlotByKey(_DictSlots_ref, key, position);

if (slot == NULL || !slot.IsUsed()) {
if (slot == NULL || !slot PTR_DEREF IsUsed()) {
Alert("Invalid DictStruct key \"", key, "\" (called by [] operator). Returning empty structure.");
DebugBreak();
static V _empty;
return _empty;
}

return slot.value;
return slot PTR_DEREF value;
}

/**
Expand All @@ -166,7 +166,7 @@ class DictStruct : public DictBase<K, V> {
return _empty;
}

return slot.value;
return slot PTR_DEREF value;
}

/**
Expand All @@ -183,7 +183,7 @@ class DictStruct : public DictBase<K, V> {
return _default;
}

return slot.value;
return slot PTR_DEREF value;
}

/**
Expand All @@ -199,7 +199,7 @@ class DictStruct : public DictBase<K, V> {
return _empty;
}

return slot.value;
return slot PTR_DEREF value;
}

/**
Expand Down Expand Up @@ -231,7 +231,7 @@ class DictStruct : public DictBase<K, V> {

if (!slot) return false;

return slot.value == value;
return slot PTR_DEREF value == value;
}

/**
Expand Down
23 changes: 10 additions & 13 deletions Task/Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,16 @@ class Task {
unsigned int _counter = 0;
for (DictStructIterator<short, TaskEntry> iter = tasks.Begin(); iter.IsValid(); ++iter) {
TaskEntry _entry = iter.Value();
switch (_value) {
case false:
if (_entry.HasFlag(_flag)) {
_entry.SetFlag(_flag, _value);
_counter++;
}
break;
case true:
if (!_entry.HasFlag(_flag)) {
_entry.SetFlag(_flag, _value);
_counter++;
}
break;
if (!_value) {
if (_entry.HasFlag(_flag)) {
_entry.SetFlag(_flag, _value);
_counter++;
}
} else {
if (!_entry.HasFlag(_flag)) {
_entry.SetFlag(_flag, _value);
_counter++;
}
}
}
return _counter > 0;
Expand Down

0 comments on commit c3ca6da

Please sign in to comment.