From c2caba9ed1a540f706cb882e92a62d6a2105a177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sun, 27 Feb 2022 14:39:52 +0000 Subject: [PATCH] src: remove dead code in AddFingerprintDigest This function is never called with md_size == 0, and it would make no sense to do so in the future either. --- src/crypto/crypto_common.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index 3ec1152adc0f2a..0dc13fb9f77adf 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -431,11 +431,8 @@ void AddFingerprintDigest( fingerprint[(3*i)+2] = ':'; } - if (md_size > 0) { - fingerprint[(3*(md_size-1))+2] = '\0'; - } else { - fingerprint[0] = '\0'; - } + DCHECK_GT(md_size, 0); + fingerprint[(3 * (md_size - 1)) + 2] = '\0'; } template