Skip to content

Instantly share code, notes, and snippets.

@canoon
Created August 24, 2013 11:58
Show Gist options
  • Save canoon/6327711 to your computer and use it in GitHub Desktop.
Save canoon/6327711 to your computer and use it in GitHub Desktop.
diff ./state.cpp ../state.cpp
42,43c42,43
< unordered_map<string, string::size_type>& visitedWords,
< priority_queue<state>& states) {
---
> unordered_map<string, string::size_type>* visitedWords,
> priority_queue<state>* states) {
53,54c53,54
< && (visitedWords.count(s) == 0
< || visitedWords[s] == 1 + this->visited.size())
---
> && (visitedWords->count(s) == 0
> || (*visitedWords)[s] == 1 + this->visited.size())
56,57c56,57
< states.push(state(s, visited));
< visitedWords.insert(make_pair(s, visited.size() + 1));
---
> states->push(state(s, visited));
> visitedWords->insert(make_pair(s, visited.size() + 1));
74c74
< threads.push_back(thread(helper(i, lexicon, visitedWords, states)));
---
> threads.push_back(thread(&state::helper, this, i, lexicon, &visitedWords, &states));
77c77
< for(auto &t : threads){
---
> for(auto &t : threads){
79c79
< }
---
> }
Only in ..: .state.cpp.swp
diff ./state.h ../state.h
39,40c39,40
< unordered_map<string, string::size_type>& visitedWords,
< priority_queue<state>& states);
---
> unordered_map<string, string::size_type>* visitedWords,
> priority_queue<state>* states);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment