summaryrefslogtreecommitdiff
path: root/src/cache.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-14 23:40:25 -0400
committerbd <bdunahu@operationnull.com>2025-04-14 23:40:25 -0400
commita7620015acc2401165b4587cbb6c9a118d944493 (patch)
tree5bbe698fe42a7d32578df6170e464508a78a8e50 /src/cache.cc
parent2140a23041d3920e001457f2c2acb0853094963d (diff)
Add preprocess method to storage, removing nearly all duplication
Diffstat (limited to 'src/cache.cc')
-rw-r--r--src/cache.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/cache.cc b/src/cache.cc
index ee4b00c..68047ed 100644
--- a/src/cache.cc
+++ b/src/cache.cc
@@ -58,13 +58,7 @@ Cache::read_word(void *id, int address, signed int &data)
int
Cache::process(void *id, int address, std::function<void(int index, int offset)> request_handler)
{
- if (id == nullptr)
- throw std::invalid_argument("Accessor cannot be nullptr.");
-
- if (this->current_request == nullptr)
- this->current_request = id;
-
- if (this->current_request != id)
+ if (!preprocess(id))
return 0;
if (is_address_missing(address))