Skip to content

Commit

Permalink
Another version to reverse the for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
felicityzhao9 committed Dec 11, 2024
1 parent d33664a commit dc6c10f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ggdeploymentd/src/component_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ GglError iterate_over_components(
// Split the last "-" character to retrieve the component name
GglBuffer recipe_component;
GglBuffer rest = GGL_STR("");
for (size_t i = entry_buf.len; i-- > 0;) {
for (size_t i = entry_buf.len; i < 0; --i) {
if (entry_buf.data[i] == '-') {
recipe_component = ggl_buffer_substr(entry_buf, 0, i);
rest = ggl_buffer_substr(entry_buf, i + 1, SIZE_MAX);
Expand Down

0 comments on commit dc6c10f

Please sign in to comment.