aoc2020 | Advent of Code 2020 : Мade with Rust | Learning library
kandi X-RAY | aoc2020 Summary
kandi X-RAY | aoc2020 Summary
Advent of Code 2020: Мade with Rust
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of aoc2020
aoc2020 Key Features
aoc2020 Examples and Code Snippets
Community Discussions
Trending Discussions on aoc2020
QUESTION
I was doing the AoC day six challenge when I noticed a bug in my program.
In the code below, when using List
.Clear()
and the end of the loop I had 486 copies of the last List
's values. I found a fix (hack?) but I want to know why .Clear()
isn't working on my List
. Full program can be found here.
ANSWER
Answered 2020-Dec-26 at 17:25Clear()
doesn't create a new instance, and Add()
doesn't create a copy.
So with only buffer.Clear()
, the else
block was adding a reference to the same List instance to groups
on each iteration, which was also emptied.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aoc2020
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page