Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jamie Mansfield
asm
Commits
9412ed77
Commit
9412ed77
authored
Jun 20, 2018
by
Jason Zaugg
Browse files
Short circuit instruction set containsAll based on set size
parent
c72a86bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java
View file @
9412ed77
...
...
@@ -201,7 +201,7 @@ public class SourceInterpreter extends Interpreter<SourceValue> implements Opcod
return
new
SourceValue
(
Math
.
min
(
value1
.
size
,
value2
.
size
),
setUnion
);
}
}
if
(
value1
.
size
!=
value2
.
size
||
!
value1
.
insns
.
containsAll
(
value2
.
insns
))
{
if
(
value1
.
size
!=
value2
.
size
||
!
containsAll
(
value1
.
insns
,
value2
.
insns
))
{
HashSet
<
AbstractInsnNode
>
setUnion
=
new
HashSet
<
AbstractInsnNode
>();
setUnion
.
addAll
(
value1
.
insns
);
setUnion
.
addAll
(
value2
.
insns
);
...
...
@@ -209,4 +209,9 @@ public class SourceInterpreter extends Interpreter<SourceValue> implements Opcod
}
return
value1
;
}
private
static
<
A
>
boolean
containsAll
(
Set
<
A
>
self
,
Set
<
A
>
other
)
{
if
(
self
.
size
()
<
other
.
size
())
return
false
;
return
self
.
containsAll
(
other
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment