square / okhttp

Square’s meticulous HTTP client for the JVM, Android, and GraalVM.

Home Page:https://square.github.io/okhttp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A suggestion for the removeEntry function in the DiskLruCache class

rladmsdh opened this issue · comments

In the existing code, we used the let function to work with the JournalWriter in the RemoveEntry function. Using Apply instead of let allows you to remove the unnecessary it and access the object's methods directly.
Additionally, the completeEdit function in the same file also uses apply as a scope function for journalWriter, so it will help maintain the code style.