You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2024/06/14 22:16:07 UTC
(groovy) branch master updated: Trivial refactor: replace `while` with enhanced `for`
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new f9a2bef166 Trivial refactor: replace `while` with enhanced `for`
f9a2bef166 is described below
commit f9a2bef166979e1682e458f37c518d658627b518
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Jun 15 07:15:49 2024 +0900
Trivial refactor: replace `while` with enhanced `for`
---
.../groovy/console/ui/text/StructuredSyntaxDocumentFilter.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/text/StructuredSyntaxDocumentFilter.java b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/text/StructuredSyntaxDocumentFilter.java
index afa6736b9b..93822e7ecb 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/text/StructuredSyntaxDocumentFilter.java
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/text/StructuredSyntaxDocumentFilter.java
@@ -329,9 +329,8 @@ public class StructuredSyntaxDocumentFilter extends DocumentFilter {
if (!regexp.toString().isEmpty()) {
matcher = Pattern.compile(regexp.substring(1)).matcher("");
- Iterator<LexerNode> iter = children.values().iterator();
- while (iter.hasNext()) {
- (iter.next()).initialize();
+ for (LexerNode lexerNode : children.values()) {
+ lexerNode.initialize();
}
}
initialized = true;