Skip to content

Commit fd8940c

Browse files
committed
address comment
1 parent 7a550bf commit fd8940c

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

pkgs/json_syntax_generator/lib/src/generator/helper_library.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ class JsonReader {
207207
/// Traverses a JSON path, returns `null` if the path cannot be traversed.
208208
Object? tryTraverse(List<String> path) {
209209
Object? json = this.json;
210-
while (path.isNotEmpty) {
211-
final key = path.removeAt(0);
210+
for (final key in path) {
212211
if (json is! Map<String, Object?>) {
213212
return null;
214213
}

pkgs/native_assets_cli/lib/src/code_assets/syntax.g.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,7 @@ class JsonReader {
11711171
/// Traverses a JSON path, returns `null` if the path cannot be traversed.
11721172
Object? tryTraverse(List<String> path) {
11731173
Object? json = this.json;
1174-
while (path.isNotEmpty) {
1175-
final key = path.removeAt(0);
1174+
for (final key in path) {
11761175
if (json is! Map<String, Object?>) {
11771176
return null;
11781177
}

pkgs/native_assets_cli/lib/src/data_assets/syntax.g.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,7 @@ class JsonReader {
316316
/// Traverses a JSON path, returns `null` if the path cannot be traversed.
317317
Object? tryTraverse(List<String> path) {
318318
Object? json = this.json;
319-
while (path.isNotEmpty) {
320-
final key = path.removeAt(0);
319+
for (final key in path) {
321320
if (json is! Map<String, Object?>) {
322321
return null;
323322
}

pkgs/native_assets_cli/lib/src/hook/syntax.g.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,7 @@ class JsonReader {
765765
/// Traverses a JSON path, returns `null` if the path cannot be traversed.
766766
Object? tryTraverse(List<String> path) {
767767
Object? json = this.json;
768-
while (path.isNotEmpty) {
769-
final key = path.removeAt(0);
768+
for (final key in path) {
770769
if (json is! Map<String, Object?>) {
771770
return null;
772771
}

0 commit comments

Comments
 (0)