Skip to content

Commit 9758167

Browse files
committed
Code cleanup
1 parent bfa5162 commit 9758167

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

source/Main.bs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ sub Main (args as dynamic) as void
7373
' Downloads and stores a fallback font to tmp:/
7474
configEncoding = api.system.GetConfigurationByName("encoding")
7575

76-
if isValid(configEncoding) and isValid(configEncoding.EnableFallbackFont)
76+
if isChainValid(configEncoding, "EnableFallbackFont")
7777
if configEncoding.EnableFallbackFont
7878
re = CreateObject("roRegex", "Name.:.(.*?).,.Size", "s")
7979
filename = APIRequest("FallbackFont/Fonts").GetToString()
8080
if isValid(filename)
8181
filename = re.match(filename)
82-
if isValid(filename) and filename.count() > 0
82+
if isValidAndNotEmpty(filename)
8383
filename = filename[1]
8484
APIRequest("FallbackFont/Fonts/" + filename).gettofile("tmp:/font")
8585
end if
@@ -89,8 +89,8 @@ sub Main (args as dynamic) as void
8989

9090
' Delete any old library filters
9191
for each settingKeys in m.global.session.user.settings.keys()
92-
if left(settingKeys, 8) = "display."
93-
if right(settingKeys, 7) = ".filter" or right(settingKeys, 14) = ".filterOptions"
92+
if isStringEqual(left(settingKeys, 8), "display.")
93+
if isStringEqual(right(settingKeys, 7), ".filter") or isStringEqual(right(settingKeys, 14), ".filterOptions")
9494
m.global.session.user.settings.delete(settingKeys)
9595
unset_user_setting(settingKeys)
9696
end if
@@ -136,10 +136,6 @@ sub Main (args as dynamic) as void
136136
' Check if we were sent content to play with the startup command (Deep Link)
137137
handleDeepLinking(args)
138138

139-
' This is the core logic loop. Mostly for transitioning between scenes
140-
' This now only references m. fields so could be placed anywhere, in theory
141-
' "group" is always "whats on the screen"
142-
' m.scene's children is the "previous view" stack
143139
while true
144140
msg = wait(0, m.port)
145141

0 commit comments

Comments
 (0)