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

Bug or outdated/wrong comment? #3418

Closed
cloudhan opened this issue Jun 26, 2019 · 1 comment
Closed

Bug or outdated/wrong comment? #3418

cloudhan opened this issue Jun 26, 2019 · 1 comment
Labels

Comments

@cloudhan
Copy link
Contributor

When I skimming through some code, I find

kaldi/src/util/stl-utils.h

Lines 98 to 109 in 8ce3a95

template<class T>
void CopySetToVector(const unordered_set<T> &s, std::vector<T> *v) {
// adds members of s to v, in sorted order from lowest to highest
// (because the set was in sorted order).
KALDI_ASSERT(v != NULL);
v->resize(s.size());
typename unordered_set<T>::const_iterator siter = s.begin(), send = s.end();
typename std::vector<T>::iterator viter = v->begin();
for (; siter != send; ++siter, ++viter) {
*viter = *siter;
}
}

It states (because the set was in sorted order). But the set is an unordered_set, is it a bug or simply forgetting to remove the comment when copying code from the set version of CopySetToVector?

@cloudhan cloudhan added the bug label Jun 26, 2019
@danpovey
Copy link
Contributor

yes the comment is wrong. if you make a PR to remove it I would merge, but won't leave the issue up (too minor)

cloudhan added a commit to cloudhan/kaldi that referenced this issue Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants