Skip to content

IDE0057: Slice can be simplified #3879

Answered by YairHalberstadt
msedi asked this question in General
Discussion options

You must be logged in to vote

What is the benefit only less text.

Correct, although I would argue it's more that's it's more declarative than less text. I don't know what the parameters to slice are. Length? Start? Finish? But ranges are a well known construct.

I would think a range is created here that slows down performance?

The runtime team works very hard to make sure that isn't the case. They definitely will treat it as a bug if the Jit output is worse.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@svick
Comment options

@msedi
Comment options

@YairHalberstadt
Comment options

@YairHalberstadt
Comment options

@BreyerW
Comment options

Answer selected by msedi
Comment options

You must be logged in to vote
1 reply
@msedi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants