zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From narahari92 <...@git.apache.org>
Subject [GitHub] zookeeper pull request #539: ZOOKEEPER-3058: Do length check first before ac...
Date Fri, 08 Jun 2018 16:42:38 GMT
GitHub user narahari92 opened a pull request:

    https://github.com/apache/zookeeper/pull/539

    ZOOKEEPER-3058: Do length check first before actual byte check in compareBytes method
of Utils class

    In compareBytes method of org.apache.jute.Utils class, all the individual bytes of 2 byte
arrays are compared first and then their lengths are compared. We can improve the performance
by first having length check, since we can rule out that they aren't equal by a single if
condition(O(1) operation) rather than looping through arrays(O( n ) operation).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/narahari92/zookeeper ZOOKEEPER-3058

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zookeeper/pull/539.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #539
    
----
commit 89239f84b1d322f170973ccdafa989508a6b8f09
Author: Hosur Narahari <hosur.narhari@...>
Date:   2018-06-08T16:32:00Z

    improving compareBytes method of Utils class

----


---

Mime
View raw message