Commit b7336d90 authored by Peter Kasting's avatar Peter Kasting Committed by Chromium LUCI CQ

Fix a TODO.

Technically this variable was not uninitialized, as the caller sets it
to 0 beforehand.  But this is fragile and unclear.

Bug: none
Change-Id: I85b56897e9dd767835efa14fd8389ce3005f8e89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2586185Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836228}
parent aebe4351
......@@ -313,11 +313,11 @@ struct CheckedLshOp<T,
}
// Handle the legal corner-case of a full-width signed shift of zero.
const bool is_valid =
std::is_signed<T>::value && !x &&
as_unsigned(shift) == as_unsigned(std::numeric_limits<T>::digits);
// TODO(pkasting): Doesn't this need to set *result = 0?
return is_valid;
if (!std::is_signed<T>::value || x ||
as_unsigned(shift) != as_unsigned(std::numeric_limits<T>::digits))
return false;
*result = 0;
return true;
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment