Use range iterators for Map
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user