Skip to content

Commit

Permalink
Fix a few compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
shaeberling committed Sep 6, 2023
1 parent dce2aba commit ac33447
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/com/s13g/sauron/ImageRepository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ImageRepository @VisibleForTesting internal constructor(
// Build list of existing image repo files.
try {
mRootDirectory.walkFileTree { file ->
if (file.toString().toLowerCase().endsWith(".jpg")) {
if (file.toString().lowercase().endsWith(".jpg")) {
mImageFiles.add(ImageRepoFile(file))
log.atInfo().log("INIT: Adding existing file: %s", file)
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/s13g/sauron/ImageServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ImageServer {
private fun serveMotionJpegFrame(outputStream: OutputStream): Long {
// Make copy so that the response can take as long as it wants without blocking anything.
val copyForRequest: ByteArray
var servedTimestamp = 0L
var servedTimestamp : Long
synchronized(bytesLock) {
copyForRequest = currentImageBytes.copyOf()
servedTimestamp = lastModified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fun createTestPictureTakerFrom(directory: File): PictureTaker {
throw RuntimeException("Directory does not exist: " + directory.absolutePath)
}
val jpegFiles = directory.listFiles { _: File?, name: String ->
name.toLowerCase().endsWith(".jpg")
name.lowercase().endsWith(".jpg")
}
if (jpegFiles == null || jpegFiles.isEmpty()) {
throw RuntimeException("No JPEG files in directory " + directory.absolutePath)
Expand Down

0 comments on commit ac33447

Please sign in to comment.