Use range iterators for Map

This commit is contained in:
Lightning_A
2021-08-09 14:13:42 -06:00
parent e4dfa69bcf
commit c63b18507d
154 changed files with 1897 additions and 1897 deletions

View File

@ -403,28 +403,28 @@ void GraphNode::_notification(int p_what) {
close_rect = Rect2();
}
for (Map<int, Slot>::Element *E = slot_info.front(); E; E = E->next()) {
if (E->key() < 0 || E->key() >= cache_y.size()) {
for (const KeyValue<int, Slot> &E : slot_info) {
if (E.key < 0 || E.key >= cache_y.size()) {
continue;
}
if (!slot_info.has(E->key())) {
if (!slot_info.has(E.key)) {
continue;
}
const Slot &s = slot_info[E->key()];
const Slot &s = slot_info[E.key];
//left
if (s.enable_left) {
Ref<Texture2D> p = port;
if (s.custom_slot_left.is_valid()) {
p = s.custom_slot_left;
}
p->draw(get_canvas_item(), icofs + Point2(edgeofs, cache_y[E->key()]), s.color_left);
p->draw(get_canvas_item(), icofs + Point2(edgeofs, cache_y[E.key]), s.color_left);
}
if (s.enable_right) {
Ref<Texture2D> p = port;
if (s.custom_slot_right.is_valid()) {
p = s.custom_slot_right;
}
p->draw(get_canvas_item(), icofs + Point2(get_size().x - edgeofs, cache_y[E->key()]), s.color_right);
p->draw(get_canvas_item(), icofs + Point2(get_size().x - edgeofs, cache_y[E.key]), s.color_right);
}
}