Skip to content

Commit

Permalink
a while is better than a for
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Oct 3, 2024
1 parent daffe02 commit d2514b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zm_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ void Event::Run() {

MYSQL_RES *result = zmDbFetch(sql);
if (result) {
for (int i = 0; MYSQL_ROW dbrow = mysql_fetch_row(result); i++) {
while(MYSQL_ROW dbrow = mysql_fetch_row(result)) {
storage = new Storage(atoi(dbrow[0]));
if (SetPath(storage))
break;
Expand All @@ -627,7 +627,7 @@ void Event::Run() {

result = zmDbFetch(sql);
if (result) {
for (int i = 0; MYSQL_ROW dbrow = mysql_fetch_row(result); i++) {
while (MYSQL_ROW dbrow = mysql_fetch_row(result)) {
storage = new Storage(atoi(dbrow[0]));
if (SetPath(storage))
break;
Expand Down

0 comments on commit d2514b5

Please sign in to comment.