Skip to content

Commit

Permalink
Keep less empty maps in memory
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed Sep 5, 2023
1 parent 55d07aa commit f337313
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/kotlin/svnserver/repository/git/GitBranch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import java.io.IOException
import java.nio.charset.StandardCharsets
import java.util.*
import java.util.concurrent.locks.ReentrantReadWriteLock
import kotlin.collections.HashMap

class GitBranch(val repository: GitRepository, val shortBranchName: String) {
val uuid: String
Expand Down Expand Up @@ -312,7 +313,12 @@ class GitBranch(val repository: GitRepository, val shortBranchName: String) {
result[StringHelper.normalize(diff.newPath)] = StringHelper.normalize(diff.oldPath)
}
}
return result

return if (result.isEmpty()) {
emptyMap()
} else {
result
}
}

fun getRevisionByDate(dateTime: Long): GitRevision {
Expand Down

0 comments on commit f337313

Please sign in to comment.