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

Use map in class_list #4363

Merged
merged 1 commit into from Jul 8, 2018

Conversation

lisitsyn
Copy link
Member

@lisitsyn lisitsyn commented Jul 8, 2018

No description provided.

@lisitsyn lisitsyn requested a review from karlnapf July 8, 2018 12:52

static class_list_entry_t class_list[] = {
static const std::map<std::string, CreateFunction> classes = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is O(logn) rather than O(n) ?
Good call!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah map fits better here. It became possible since we use initializer list here {} and C++11 is enabled.

Copy link
Member

@karlnapf karlnapf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lisitsyn lisitsyn merged commit b626889 into shogun-toolbox:develop Jul 8, 2018
ktiefe pushed a commit to ktiefe/shogun that referenced this pull request Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants