MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / deDup

Method deDup

src/Bytes.java:584–586  ·  view source on GitHub ↗

De-duplicates two byte arrays. If two byte arrays have the same contents but are different, this function helps to re-use the old one and discard the new copy. @param old The existing byte array. @param neww The new byte array we're trying to de-duplicate. @return old if neww is

(final byte[] old, final byte[] neww)

Source from the content-addressed store, hash-verified

582 * contents, otherwise {@code neww}.
583 */
584 public static byte[] deDup(final byte[] old, final byte[] neww) {
585 return memcmp(old, neww) == 0 ? old : neww;
586 }
587
588 /**
589 * Tests whether two byte arrays have the same contents.

Callers 2

fromBufferMethod · 0.95
fromCellMethod · 0.95

Calls 1

memcmpMethod · 0.95

Tested by

no test coverage detected