Skip to content
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

Merged
merged 7 commits into from
May 14, 2018

Conversation

AndreMouche
Copy link
Member

hi, this PR remove the read trait from datum and table in decode function.
@BusyJay @breeswish @hicqu PTAL

pub fn decode_datum(data: &mut BytesSlice) -> Result<Datum> {
if !data.is_empty() {
let flag = data[0];
*data = unsafe { data.get_unchecked(1..) };
Copy link
Member

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?

Copy link
Member

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.

@breezewish
Copy link
Member

LGTM

@breezewish
Copy link
Member

/run-integration-tests

@AndreMouche
Copy link
Member Author

friendly ping @BusyJay @hicqu

@hicqu
Copy link
Contributor

hicqu commented May 14, 2018

LGTM.

@AndreMouche AndreMouche merged commit 50ffd29 into tikv:master May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants