mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-01 04:28:51 +00:00
Changing the sublice does not change the original slice #1554
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#1554
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Turalchik on GitHub (Sep 16, 2025).
Current Behavior
Test returns 0.
Expected Behavior
Test should return 42.
Possible Solution
Perhaps you don't need to create a copy of the original slice when creating a subslice.
Steps to Reproduce
Run the test above.
Your Environment
v0.112.0
@roman-khimov commented on GitHub (Oct 1, 2025):
We can emulate subslices efficiently with buffers for known at compile time offsets (
[:1], it's just a matter of tracking additional data for variables to emit code properly. But dynamic slicing ([:x]) is a problem requiring additional data, can be emulated with a structure, but this incurs significant performance penalty.