diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-11-02 19:50:34 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-11-02 19:50:52 -0800 |
commit | a3f779158626b9ad3c81959b85cbfbbce17425fd (patch) | |
tree | 10c9da6ee8783a2ed2a3e6e928fb5d70024d1bcc /apps/browse/paginated-screen.mu | |
parent | 951c3f4c92358d3962154a4ef24a19366ea8a619 (diff) | |
download | mu-a3f779158626b9ad3c81959b85cbfbbce17425fd.tar.gz |
7159 - explicitly use 'return' everywhere
https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 2.
Diffstat (limited to 'apps/browse/paginated-screen.mu')
-rw-r--r-- | apps/browse/paginated-screen.mu | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/apps/browse/paginated-screen.mu b/apps/browse/paginated-screen.mu index 9d02dcce..783a1cac 100644 --- a/apps/browse/paginated-screen.mu +++ b/apps/browse/paginated-screen.mu @@ -122,8 +122,7 @@ fn start-drawing _self: (addr paginated-screen) { reposition-cursor self } -fn done-drawing? _self: (addr paginated-screen) -> result/eax: boolean { -$done-drawing?:body: { +fn done-drawing? _self: (addr paginated-screen) -> _/eax: boolean { # if (self->leftcol == left-margin + 1) return false var self/esi: (addr paginated-screen) <- copy _self var tmp/eax: (addr int) <- get self, left-margin @@ -133,8 +132,7 @@ $done-drawing?:body: { $done-drawing:first-page?: { compare first-col, *tmp break-if-!= - result <- copy 0 - break $done-drawing?:body + return 0 # false } # return self->rightcol > self->ncols + 1 tmp <- get self, ncols @@ -149,14 +147,9 @@ $done-drawing?:body: { compare *tmp, max { break-if-> - result <- copy 0 # false - break $done-drawing?:body + return 0 # false } - { - break-if-<= - result <- copy 1 # true - } -} + return 1 # true } fn add-grapheme _self: (addr paginated-screen), c: grapheme { |