Compare commits
2 Commits
1623b8b240
...
74cad036f8
Author | SHA1 | Date | |
---|---|---|---|
74cad036f8 | |||
03036ff185 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
*.o
|
||||
*
|
||||
*.vscode
|
@ -21,7 +21,7 @@ public:
|
||||
TwoCache(size_t q1sz, size_t q2sz): cpct_q1(q1sz), cpct_q2(q2sz) {} //ctor
|
||||
|
||||
void put_page(int id) {
|
||||
if (umap1.find(id) != umap1.end()) { //page is in fast queue in the end, nothing to do (fast case)
|
||||
if (umap1.find(id) != umap1.end()) { //page is found, nothing to do (fast case)
|
||||
return;
|
||||
} else if (umap2.find(id) != umap2.end()) {
|
||||
q2.erase(umap2[id]); //if page is in slow put it in fast
|
||||
@ -76,7 +76,7 @@ public:
|
||||
answer += std::to_string(*i) + " ";
|
||||
}
|
||||
|
||||
answer.pop_back();
|
||||
answer.pop_back(); //delete last space
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user