ams: replace most remaining operator & with std::addressof
This commit is contained in:
@@ -50,11 +50,11 @@ namespace ams::ncm {
|
||||
|
||||
void Store(ContentId content_id, ncm::RightsId rights_id) {
|
||||
std::scoped_lock lk(this->mutex);
|
||||
Entry *eviction_candidate = &this->entries[0];
|
||||
Entry *eviction_candidate = std::addressof(this->entries[0]);
|
||||
|
||||
/* Find a suitable existing entry to store our new one at. */
|
||||
for (size_t i = 1; i < MaxEntries; i++) {
|
||||
Entry *entry = &this->entries[i];
|
||||
Entry *entry = std::addressof(this->entries[i]);
|
||||
|
||||
/* Change eviction candidates if the uuid already matches ours, or if the uuid doesn't already match and the last_accessed count is lower */
|
||||
if (content_id == entry->uuid || (content_id != eviction_candidate->uuid && entry->last_accessed < eviction_candidate->last_accessed)) {
|
||||
@@ -73,7 +73,7 @@ namespace ams::ncm {
|
||||
|
||||
/* Attempt to locate the content id in the cache. */
|
||||
for (size_t i = 0; i < MaxEntries; i++) {
|
||||
Entry *entry = &this->entries[i];
|
||||
Entry *entry = std::addressof(this->entries[i]);
|
||||
|
||||
if (entry->last_accessed != 1 && content_id == entry->uuid) {
|
||||
entry->last_accessed = this->counter;
|
||||
|
||||
Reference in New Issue
Block a user