Re: [PATCH v2] Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with()

2014-03-23 Thread Eric Sunshine
In addition to the valuable review comments already provided by Alexandru and David, see a few more below. On Sat, Mar 22, 2014 at 5:25 PM, Mustafa Orkun Acar mustafaorkuna...@gmail.com wrote: Subject: [PATCH v2] Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with() This isn't

[PATCH v2] Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with()

2014-03-22 Thread Mustafa Orkun Acar
I reviewed all functions using memcmp(). It generally makes code more understandable. But here it might be used for the sake of simplicity. Signed-off-by: Mustafa Orkun Acar mustafaorkuna...@gmail.com --- I applied to GSoC 2014. I expect your feedbacks and comments! strbuf.c | 2 +- 1 file

Re: [PATCH v2] Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with()

2014-03-22 Thread Alexandru Guduleasa
Hi, This does not seam correct to me. The memcmp function could have returned 3 relevant values (zero, positive and negative) and a non-zero result would have been returned by the if statement. With you modification, you replace a negative value from memcmp with a positive one. Best regards,

Re: [PATCH v2] Rewrite strbuf.c:strbuf_cmp() replace memcmp() with starts_with()

2014-03-22 Thread David Kastrup
Mustafa Orkun Acar mustafaorkuna...@gmail.com writes: I reviewed all functions using memcmp(). It generally makes code more understandable. But here it might be used for the sake of simplicity. Signed-off-by: Mustafa Orkun Acar mustafaorkuna...@gmail.com --- I applied to GSoC 2014. I