Open
Conversation
added 6 commits
October 1, 2018 10:57
* Updates the code to use PSR-2 formatting (https://www.php-fig.org/psr/psr-2/). This requires some changes to formatting of class and method names. * Adds composer to the project. Currently only pulls in `phpunit` as a development requirement. * Adds `phpunit` tests created from the `example.php` code along with testing the various exceptions that can be thrown. * Some code polish based on static analysis.
* Rename class to `Search`, search method to `execute`, and push file into `src` directory. Give it a nice namespace to live in. * Update benchmark, example, and documentation to show namespace usage. * Add PSR-4 namespace autoload to composer.
* Move benchmarking functionality into its own class.
* Removing example PSR-4 path from composer
* Update documentation for installation via composer
* Update documentation for installation via composer
sprak3000
commented
Oct 1, 2018
| if (!isset($nodes[$u][0])) { | ||
| $nodes[$u][0] = []; | ||
| } | ||
| $nodes[$u][0] = array_merge($nodes[$u][0], $nodes[$nodes[$u][1]][0]); |
Author
There was a problem hiding this comment.
Static analysis identified this as another possible optimization. I haven't touched it yet where I don't have a full grasp of the code at this time and how it would relate to moving the merge process out of the loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses Issue #1 in the following ways:
phpunitbased unit tests.