ams: replace most remaining operator & with std::addressof

This commit is contained in:
Michael Scire
2021-10-09 14:49:53 -07:00
parent ce8aacef21
commit 1ab0bd1765
109 changed files with 587 additions and 586 deletions

View File

@@ -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;