Skip to content

Commit 4fd7482

Browse files
committed
Lift return out of try
1 parent ab202ca commit 4fd7482

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/com/coder/gateway/sdk/CoderCLIManager.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,20 @@ class CoderCLIManager @JvmOverloads constructor(deployment: URL, destinationDir:
124124
* Return the entity tag for the binary on disk, if any.
125125
*/
126126
private fun getBinaryETag(): String? {
127-
try {
127+
return try {
128128
val md = MessageDigest.getInstance("SHA-1")
129129
val fis = FileInputStream(localBinaryPath.toFile())
130130
val dis = DigestInputStream(BufferedInputStream(fis), md)
131131
fis.use {
132132
while (dis.read() != -1) {
133133
}
134134
}
135-
return HexBinaryAdapter().marshal(md.digest()).lowercase()
135+
HexBinaryAdapter().marshal(md.digest()).lowercase()
136136
} catch (e: FileNotFoundException) {
137-
return null
137+
null
138138
} catch (e: Exception) {
139139
logger.warn("Unable to calculate hash for ${localBinaryPath.toAbsolutePath()}", e)
140-
return null
140+
null
141141
}
142142
}
143143

0 commit comments

Comments
 (0)