Skip to content

Commit 7b4b8e4

Browse files
committed
refactor redundant checks
1 parent c634328 commit 7b4b8e4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/amazonq/src/lsp/auth.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,8 @@ export class AmazonQLspAuth {
109109
}
110110

111111
private areCredentialsEqual(creds1: any, creds2: any): boolean {
112-
if (!creds1 && !creds2) {
113-
return true
114-
}
115112
if (!creds1 || !creds2) {
116-
return false
113+
return creds1 === creds2
117114
}
118115

119116
return (

packages/core/src/auth/credentials/store.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export class CredentialsStore {
3838
const expiration = this.credentialsCache[key].credentials.expiration
3939
const now = new globals.clock.Date()
4040
const bufferedNow = new globals.clock.Date(now.getTime() + expirationBufferMs)
41-
const isValid = expiration !== undefined ? expiration >= bufferedNow : true
42-
return isValid
41+
return expiration !== undefined ? expiration >= bufferedNow : true
4342
}
4443
getLogger().debug(`credentials: no credentials found for ${key}`)
4544
return false

0 commit comments

Comments
 (0)