Lint responseCount

This commit is contained in:
sim 2024-11-04 14:25:47 +00:00
parent fa56b43a83
commit 15e149f76b
1 changed files with 5 additions and 4 deletions

View File

@ -94,11 +94,12 @@ class DirectAccount(context: Context) : Account<OkHttpClient> {
return response.request.newBuilder().header("Authorization", credential).build()
}
private fun responseCount(_response: Response): Int {
var response = _response
/** Count number of authentication request/response */
private fun responseCount(response: Response): Int {
var mutResponse = response
var result = 1
while (response.priorResponse?.also {
response = it
while (mutResponse.priorResponse?.also {
mutResponse = it
} != null
) {
result++