Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7163841
D8583.id30987.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D8583.id30987.diff
View Options
diff --git a/java/src/main/java/org/softwareheritage/graph/rpc/Traversal.java b/java/src/main/java/org/softwareheritage/graph/rpc/Traversal.java
--- a/java/src/main/java/org/softwareheritage/graph/rpc/Traversal.java
+++ b/java/src/main/java/org/softwareheritage/graph/rpc/Traversal.java
@@ -280,25 +280,23 @@
}
super.visitNode(node);
- boolean nodeMatchesConstraints = true;
-
- if (request.getReturnNodes().hasMinTraversalSuccessors()) {
- nodeMatchesConstraints &= traversalSuccessors >= request.getReturnNodes().getMinTraversalSuccessors();
+ if (request.getReturnNodes().hasMinTraversalSuccessors()
+ && traversalSuccessors < request.getReturnNodes().getMinTraversalSuccessors()) {
+ nodeBuilder = null;
}
- if (request.getReturnNodes().hasMaxTraversalSuccessors()) {
- nodeMatchesConstraints &= traversalSuccessors <= request.getReturnNodes().getMaxTraversalSuccessors();
+ if (request.getReturnNodes().hasMaxTraversalSuccessors()
+ && traversalSuccessors > request.getReturnNodes().getMaxTraversalSuccessors()) {
+ nodeBuilder = null;
}
- if (nodeMatchesConstraints) {
- if (nodeBuilder != null) {
- nodeObserver.onNext(nodeBuilder.build());
+ if (nodeBuilder != null) {
+ nodeObserver.onNext(nodeBuilder.build());
- if (remainingMatches >= 0) {
- remainingMatches--;
- if (remainingMatches == 0) {
- // We matched as many nodes as allowed
- throw new StopTraversalException();
- }
+ if (remainingMatches >= 0) {
+ remainingMatches--;
+ if (remainingMatches == 0) {
+ // We matched as many nodes as allowed
+ throw new StopTraversalException();
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 4:38 PM (5 h, 35 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219903
Attached To
D8583: SimpleTraversal.visitNode: Remove redundant boolean
Event Timeline
Log In to Comment