code: remove useless `or else` now that they are detected
authorJean Privat <jean@pryen.org>
Sat, 4 Apr 2015 15:46:56 +0000 (22:46 +0700)
committerJean Privat <jean@pryen.org>
Wed, 8 Apr 2015 00:52:02 +0000 (07:52 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>

contrib/benitlux/src/benitlux_daily.nit
contrib/pep8analysis/src/flow_analysis/framework.nit
lib/ai/search.nit
lib/github/github_curl.nit
src/nitdbg_client.nit
src/platform/app_annotations.nit

index 35aa64c..bb6d1fa 100644 (file)
@@ -230,11 +230,11 @@ if not opts.errors.is_empty or opts.help.value == true then
 end
 
 var ben = new Benitlux("sherbrooke")
-ben.run(opts.send_emails.value or else false)
+ben.run(opts.send_emails.value)
 
 # The parsing logic for the wellington locaiton is active (to gather data)
 # but the web interface do not allow to subscribe to its mailing list.
 #
 # TODO revamp mailing list Web interface
 ben = new Benitlux("wellington")
-ben.run(opts.send_emails.value or else false)
+ben.run(opts.send_emails.value)
index e32246c..338836b 100644 (file)
@@ -52,7 +52,7 @@ class FlowAnalysis[S]
                        end
 
                        if current_in != null then
-                               in_set(block) = current_in.as(not null)
+                               in_set(block) = current_in
                        else
                                continue
                        end
@@ -61,7 +61,7 @@ class FlowAnalysis[S]
 
                        var old_out = out_set(block)
                        for line in block.lines do
-                               self.current_in = current_in.as(not null)
+                               self.current_in = current_in
                                self.current_out = empty_set
                                pre_line_visit(line)
                                enter_visit(line)
index 69b5c0d..f406949 100644 (file)
@@ -731,7 +731,7 @@ class SearchNode[S: Object, A]
                print "result:{state}"
                for n in path do
                        var a = n.action
-                       if a != null then print "    + {a or else ""}"
+                       if a != null then print "    + {a}"
                        print "  {n.steps}: {n.state} ({n.cost}$)"
                end
        end
index cc12923..8e70600 100644 (file)
@@ -82,7 +82,7 @@ class GithubCurl
                        if obj isa JsonObject then
                                if obj.keys.has("message") then
                                        var title = "GithubAPIError"
-                                       var msg = obj["message"].to_s or else ""
+                                       var msg = obj["message"].to_s
                                        var err = new GithubError(msg, title)
                                        err.json["requested_uri"] = uri
                                        err.json["status_code"] = response.status_code
index 349f53c..b12e1e9 100644 (file)
@@ -81,7 +81,7 @@ else
 end
 
 print "[HOST ADDRESS] : {debug.address}"
-print "[HOST] : {debug.host or else "unamed"}"
+print "[HOST] : {debug.host}"
 print "[PORT] : {debug.port}"
 print "Connecting ... {debug.connected}"
 
index ab0b067..67af354 100644 (file)
@@ -68,9 +68,9 @@ class AppProject
        end
 
        redef fun to_s do return """
-name: {{{name or else "null"}}}
-namespace: {{{namespace or else "null"}}}
-version: {{{version or else "null"}}}"""
+name: {{{name}}}
+namespace: {{{namespace}}}
+version: {{{version}}}"""
 end
 
 redef class AAnnotation