Skip to content

Commit f2d43db

Browse files
authored
Remove a redundant flag in CacheVC (#12467)
There is already a flag called f.doc_from_ram_cache. This flag, f.not_from_ram_cache, is always its negation. Remove this redundant flag and fix up the one place where it's used.
1 parent fc2031d commit f2d43db

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

src/iocore/cache/CacheVC.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ CacheVC::get_data(int i, void *data)
276276
*(static_cast<CacheHTTPInfo **>(data)) = &alternate;
277277
return true;
278278
case CACHE_DATA_RAM_CACHE_HIT_FLAG:
279-
*(static_cast<int *>(data)) = !f.not_from_ram_cache;
279+
*(static_cast<int *>(data)) = f.doc_from_ram_cache;
280280
return true;
281281
default:
282282
break;
@@ -386,9 +386,6 @@ CacheVC::handleReadDone(int event, Event * /* e ATS_UNUSED */)
386386
// put into ram cache?
387387
if (io.ok() && ((doc->first_key == *read_key) || (doc->key == *read_key) || STORE_COLLISION) && doc->magic == DOC_MAGIC) {
388388
int okay = 1;
389-
if (!f.doc_from_ram_cache) {
390-
f.not_from_ram_cache = 1;
391-
}
392389
if (cache_config_enable_checksum && doc->checksum != DOC_NO_CHECKSUM) {
393390
// verify that the checksum matches
394391
uint32_t checksum = 0;

src/iocore/cache/CacheVC.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct CacheVC : public CacheVConnection {
5858
is_ram_cache_hit() const override
5959
{
6060
ink_assert(vio.op == VIO::READ);
61-
return !f.not_from_ram_cache;
61+
return f.doc_from_ram_cache;
6262
}
6363

6464
int
@@ -302,7 +302,6 @@ struct CacheVC : public CacheVConnection {
302302
unsigned int open_read_timeout : 1; // UNUSED
303303
unsigned int data_done : 1;
304304
unsigned int read_from_writer_called : 1;
305-
unsigned int not_from_ram_cache : 1; // entire object was from ram cache
306305
unsigned int rewrite_resident_alt : 1;
307306
unsigned int readers : 1;
308307
unsigned int doc_from_ram_cache : 1;

0 commit comments

Comments
 (0)