Merge pull request #35 from cohcho/fix_compare_share

store_share: modify compare_share to avoid fail
This commit is contained in:
Jethro Grassie 2020-03-03 18:20:52 -05:00 committed by GitHub
commit 3622e70b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -337,11 +337,7 @@ compare_share(const MDB_val *a, const MDB_val *b)
{
const share_t *va = (const share_t*) a->mv_data;
const share_t *vb = (const share_t*) b->mv_data;
int sc = strcmp(va->address, vb->address);
if (sc == 0)
return (va->timestamp < vb->timestamp) ? -1 : 1;
else
return sc;
return (va->timestamp < vb->timestamp) ? -1 : 1;
}
static int