Skip to content

Commit 37b9699

Browse files
committed
a bit more code shortening
1 parent 73aaf29 commit 37b9699

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/ReadTextActivity.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ class ReadTextActivity : SimpleActivity() {
100100
override fun onBackPressed() {
101101
val hasUnsavedChanges = originalText != read_text_view.text.toString()
102102
when {
103-
isSearchActive -> {
104-
closeSearch()
105-
}
103+
isSearchActive -> closeSearch()
106104
hasUnsavedChanges && System.currentTimeMillis() - lastSavePromptTS > SAVE_DISCARD_PROMPT_INTERVAL -> {
107105
lastSavePromptTS = System.currentTimeMillis()
108106
ConfirmationAdvancedDialog(this, "", R.string.save_before_closing, R.string.save, R.string.discard) {
@@ -113,9 +111,7 @@ class ReadTextActivity : SimpleActivity() {
113111
}
114112
}
115113
}
116-
else -> {
117-
super.onBackPressed()
118-
}
114+
else -> super.onBackPressed()
119115
}
120116
}
121117

0 commit comments

Comments
 (0)