Skip to content
Snippets Groups Projects
Commit 44d8583f authored by Lukas Stadler's avatar Lukas Stadler
Browse files

use getRootNode() in RNode.reportWork

parent a0221db7
Branches
No related tags found
No related merge requests found
......@@ -235,15 +235,9 @@ public abstract class RNode extends Node implements RSyntaxNode, RInstrumentable
if (amount >= WORK_SCALE_FACTOR) {
int scaledAmount = (int) (amount / WORK_SCALE_FACTOR);
if (amount > 0) {
Node current = getParent();
while (current != null && !(current instanceof RootNode)) {
current = current.getParent();
}
if (current != null) {
RootNode root = (RootNode) current;
if (root.getCallTarget() instanceof LoopCountReceiver) {
((LoopCountReceiver) root.getCallTarget()).reportLoopCount(scaledAmount);
}
RootNode root = getRootNode();
if (root.getCallTarget() instanceof LoopCountReceiver) {
((LoopCountReceiver) root.getCallTarget()).reportLoopCount(scaledAmount);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment