This commit is contained in:
Raffi Khatchadourian 2017-12-19 15:42:27 -05:00
parent d29e278291
commit fc62c16d9b
1 changed files with 5 additions and 0 deletions

View File

@ -173,6 +173,11 @@ public final class Atom implements Serializable {
public final boolean startsWith(Atom start) {
assert (start != null);
// can't start with something that's longer.
if (val.length < start.val.length)
return false;
// otherwise, we know that this length is greater than or equal to the length of start.
for (int i = 0; i < start.val.length; ++i) {
if (val[i] != start.val[i])
return false;