File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class Solution {
15
15
q_.emplace (startUrl);
16
16
unordered_set<string> lookup = {startUrl};
17
17
vector<thread> workers;
18
- const auto & worker = [this , &htmlParser]( unordered_set<string> *lookup) {
18
+ const auto & worker = [this ](HtmlParser *htmlParser, unordered_set<string> *lookup) {
19
19
while (true ) {
20
20
string from_url;
21
21
{
@@ -28,7 +28,7 @@ class Solution {
28
28
++working_count_;
29
29
}
30
30
const auto & name = hostname (from_url);
31
- for (const auto & to_url: htmlParser. getUrls (from_url)) {
31
+ for (const auto & to_url: htmlParser-> getUrls (from_url)) {
32
32
if (name != hostname (to_url)) {
33
33
continue ;
34
34
}
@@ -49,7 +49,7 @@ class Solution {
49
49
}
50
50
};
51
51
for (int i = 0 ; i < NUMBER_OF_WORKERS; ++i) {
52
- workers.emplace_back (worker, &lookup);
52
+ workers.emplace_back (worker, &htmlParser, & lookup);
53
53
}
54
54
{
55
55
unique_lock<mutex> lock{m_};
You can’t perform that action at this time.
0 commit comments