Skip to content

Commit cdaaa55

Browse files
nmzaheerkittaakos
authored andcommitted
Changed logic to avoid end value being shown twice
1 parent 3476de2 commit cdaaa55

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-input.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,15 @@ class HistoryList {
7474
if (this.index !== this.end) {
7575
this.traverse = true;
7676
this.index = (++this.index < this.size) ? this.index : 0;
77-
return this.ring[this.index];
77+
if(this.index === this.end)
78+
this.traverse = false;
7879
}
7980
else {
8081
if (!this.traverse) {
8182
return '';
8283
}
83-
else {
84-
this.traverse = false;
85-
return this.ring[this.index];
86-
}
8784
}
85+
return this.ring[this.index];
8886
}
8987
}
9088

0 commit comments

Comments
 (0)