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)
| 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. |
no test coverage detected