-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
coprocessor/codec: remove read trait from datum and table in decode f… #3060
Conversation
src/coprocessor/codec/datum.rs
Outdated
pub fn decode_datum(data: &mut BytesSlice) -> Result<Datum> { | ||
if !data.is_empty() { | ||
let flag = data[0]; | ||
*data = unsafe { data.get_unchecked(1..) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this used for? Or, do we have ways without unsafe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use &data[1..]
is the same here. Because data.is_empty()
has provide the hint to compiler.
LGTM |
/run-integration-tests |
LGTM. |
hi, this PR remove the read trait from datum and table in decode function.
@BusyJay @breeswish @hicqu PTAL