summaryrefslogtreecommitdiffstatshomepage
path: root/py/sequence.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/sequence.c')
-rw-r--r--py/sequence.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/sequence.c b/py/sequence.c
index 91162fc099..966adaac03 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -4,6 +4,7 @@
* The MIT License (MIT)
*
* Copyright (c) 2013, 2014 Damien P. George
+ * Copyright (c) 2014 Paul Sokolovsky
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -99,6 +100,10 @@ bool mp_seq_cmp_bytes(int op, const byte *data1, uint len1, const byte *data2, u
}
uint min_len = len1 < len2 ? len1 : len2;
int res = memcmp(data1, data2, min_len);
+ if (op == MP_BINARY_OP_EQUAL) {
+ // If we are checking for equality, here're the answer
+ return res == 0;
+ }
if (res < 0) {
return false;
}