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

Minor cleanup of entry.cpp for node #1514

Merged
merged 2 commits into from Dec 29, 2018

Conversation

Projects
5 participants
@wezrule
Copy link
Collaborator

commented Dec 29, 2018

I made a few changes:
1 - Reduce number of traverses of the vm tree; doing vm.count("something") and vm["something"] are both O(log) operations, but can be accomplished with a single O(log) using vm.find() instead. This also removes duplicated hardcoded strings (although that could have also been done by creating a variable), vm derives from std::map so count will always either be 0 or 1.
2 - Remove excess std::endl usage. This creates a newline, but also flushes the buffer (expensive), it is recommended to use "\n" when needing a new line instead, and only explicitly flush when necessary.
3 - Removed a warning under MSVC 2017 about converting size_t to uint32_t in the "debug_mass_activity" compound block.
4 - There were a couple of "for (uint64_t i (0); true; ++i)" blocks, but i is never used which is a bit confusing (and the front-end compiler did not pick this up either), so I have changed it to be a "while (true)" loop instead. I changed the existing for (; true; ) block to be while (true) as well for consistency.
5 - Removed some unused variable warning declarators in the catch parameter declaration, i.e e

@cryptocode cryptocode merged commit d101c8a into nanocurrency:master Dec 29, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wezrule wezrule deleted the wezrule:improve_node_entry_commands branch Dec 29, 2018

@zhyatt zhyatt added this to the V18.0 milestone Jan 2, 2019

@zhyatt zhyatt added this to CP 0 in V18 Jan 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.