Skip to content

[TH2-1559] The ability to find a matching field inside a repeating group#24

Open
alexander-zhilov wants to merge 1 commit intomasterfrom
TH2-1559
Open

[TH2-1559] The ability to find a matching field inside a repeating group#24
alexander-zhilov wants to merge 1 commit intomasterfrom
TH2-1559

Conversation

@alexander-zhilov
Copy link
Member

No description provided.

Comment on lines +75 to +85
message.getFieldsMap().forEach((key, value) -> {
if (value.hasMessageValue()) {
result.set(result.get() || checkExpectedField(value.getMessageValue(), fieldName));
}
if (value.hasListValue()) {
for (Value listEntry : value.getListValue().getValuesList()) {
result.set(result.get() || checkExpectedField(listEntry.getMessageValue(), fieldName));
}
}
});
return result.get();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it will be better to replace the forEach call with foreach loop

Suggested change
message.getFieldsMap().forEach((key, value) -> {
if (value.hasMessageValue()) {
result.set(result.get() || checkExpectedField(value.getMessageValue(), fieldName));
}
if (value.hasListValue()) {
for (Value listEntry : value.getListValue().getValuesList()) {
result.set(result.get() || checkExpectedField(listEntry.getMessageValue(), fieldName));
}
}
});
return result.get();
for (Value value : message.getFieldsMap().values()) {
if (value.hasMessageValue()) {
if (checkExpectedField(value.getMessageValue(), fieldName)) {
return true;
}
}
if (value.hasListValue()) {
for (Value listEntry : value.getListValue().getValuesList()) {
if (listEntry.hasMessageValue()) {
if (checkExpectedField(listEntry.getMessageValue(), fieldName)) {
return true;
}
}
}
}
});
return false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants