Skip to content

fix de-duplicate issue in ZUNIONTOP/ZUNIONREVTOP#9

Open
levyfan wants to merge 4 commits into
RedisLabsModules:masterfrom
levyfan:master
Open

fix de-duplicate issue in ZUNIONTOP/ZUNIONREVTOP#9
levyfan wants to merge 4 commits into
RedisLabsModules:masterfrom
levyfan:master

Conversation

@levyfan

@levyfan levyfan commented Jun 1, 2016

Copy link
Copy Markdown

fix de-duplicate issue in ZUNIONTOP/ZUNIONREVTOP #8 #8

@levyfan

levyfan commented Jun 2, 2016

Copy link
Copy Markdown
Author

@dvirsky @itamarhaber please have a review

Comment thread src/rxzsets.c Outdated

// de-duplicate
int ret = 0;
kh_put(32, h, RedisModule_StringPtrLen(entry->element, NULL), &ret);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be dangerous re NULL termination.
from client requests strigns are null terminated implicitly, but from RedisModule_Call responses they usually aren't.
You can strndup maybe and create a null terminated string if you can free it later.

@levyfan

levyfan commented Jun 3, 2016

Copy link
Copy Markdown
Author

@dvirsky Instead of copying string out, I write a hash function on RedisModuleString and put RedisModuleString into the hash set.

@levyfan

levyfan commented Jun 5, 2016

Copy link
Copy Markdown
Author

@dvirsky @itamarhaber please have a review

@dvirsky

dvirsky commented Jun 5, 2016

Copy link
Copy Markdown

@itamarhaber I'm jet lagged and tired, so... :)

@levyfan

levyfan commented Jun 30, 2016

Copy link
Copy Markdown
Author

ping @itamarhaber @dvirsky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants