Removed one line ifs and elses. (#11389)

This commit is contained in:
ComicIronic
2016-08-15 11:36:21 +01:00
committed by clusterfack
parent b2b5c81633
commit d490e1f970
914 changed files with 11196 additions and 5646 deletions

View File

@@ -24,7 +24,8 @@ datum/updateQueueWorker/proc/init(var/list/objects, var/procName, var/list/argum
datum/updateQueueWorker/proc/doWork()
// If there's nothing left to execute or we were killed, mark finished and return.
if (!objects || !objects.len) return finished()
if (!objects || !objects.len)
return finished()
lastStart = world.timeofday // Absolute number of ticks since the world started up
@@ -38,7 +39,8 @@ datum/updateQueueWorker/proc/doWork()
// If there's nothing left to execute
// or we were killed while running the above code, mark finished and return.
if (!objects || !objects.len) return finished()
if (!objects || !objects.len)
return finished()
if (world.cpu > cpuThreshold)
// We don't want to force a tick into overtime!

View File

@@ -11,7 +11,8 @@
/datum/processSchedulerView/Topic(href, href_list)
if(!check_rights(R_DEBUG)) return
if(!check_rights(R_DEBUG))
return
if (!href_list["action"])
return

View File

@@ -11,14 +11,16 @@ var/global/list/fast_machines = list()
//#ifdef PROFILE_MACHINES
//machine_profiling.len = 0
//#endif
if(!fast_machines || !fast_machines.len) return
if(!fast_machines || !fast_machines.len)
return
for(var/i = 1 to fast_machines.len)
if(i > fast_machines.len)
break
var/obj/machinery/M = fast_machines[i]
if(istype(M) && !M.gcDestroyed)
if(M.timestopped) continue
if(M.timestopped)
continue
#ifdef PROFILE_MACHINES
var/time_start = world.timeofday
#endif
@@ -51,4 +53,5 @@ var/global/list/fast_machines = list()
if(!fast_machines.Remove(M))
fast_machines.Cut(i, i + 1)
if(!(i % 20)) scheck()
if(!(i % 20))
scheck()

View File

@@ -19,14 +19,17 @@ var/global/list/html_machines = new/list() //for checking when we should update
key += "("
var/first = 1
for (var/a in item.args)
if (!first) key += ","
if (!first)
key += ","
key += "[a]"
first = 0
key += ")"
if (!(key in L))
if (item.args) call(item.ref, item.procname)(arglist(item.args))
else call(item.ref, item.procname)()
if (item.args)
call(item.ref, item.procname)(arglist(item.args))
else
call(item.ref, item.procname)()
L.Add(key)

View File

@@ -10,13 +10,15 @@ var/global/list/machines = list()
//#ifdef PROFILE_MACHINES
//machine_profiling.len = 0
//#endif
if(!machines || !machines.len) return
if(!machines || !machines.len)
return
for(var/i = 1 to machines.len)
if(i > machines.len)
break
var/obj/machinery/M = machines[i]
if(istype(M) && !M.gcDestroyed)
if(M.timestopped) continue
if(M.timestopped)
continue
#ifdef PROFILE_MACHINES
var/time_start = world.timeofday
#endif
@@ -45,4 +47,5 @@ var/global/list/machines = list()
M.inMachineList = 0
if(!machines.Remove(M))
machines.Cut(i,i+1)
if(!(i%20)) scheck()
if(!(i%20))
scheck()

View File

@@ -15,7 +15,8 @@
if (mob_list)
for(var/atom/m in mob_list)
if(m)
if(m.timestopped) continue
if(m.timestopped)
continue
m:Life()
scheck()
continue

View File

@@ -16,7 +16,8 @@ var/global/list/processing_objects = list()
if(processing_objects)
for(var/atom/o in processing_objects)
if(o)
if(o.timestopped) continue
if(o.timestopped)
continue
o:process()
scheck()
continue

View File

@@ -30,7 +30,8 @@ var/global/list/cable_list = list() //Index for all cables, so that powernets do
break
if(istype(power_machines[i], /obj/machinery))
var/obj/machinery/M = power_machines[i]
if(M.timestopped) continue
if(M.timestopped)
continue
if(!M.gcDestroyed)
#ifdef PROFILE_MACHINES
var/time_start = world.timeofday

View File

@@ -206,7 +206,8 @@
var/list/Lines = file2list(filename)
for(var/t in Lines)
if(!t) continue
if(!t)
continue
t = trim(t)
if (length(t) == 0)
@@ -628,7 +629,8 @@
/datum/configuration/proc/loadsql(filename) // -- TLE
var/list/Lines = file2list(filename)
for(var/t in Lines)
if(!t) continue
if(!t)
continue
t = trim(t)
if (length(t) == 0)
@@ -674,7 +676,8 @@
/datum/configuration/proc/loadforumsql(filename) // -- TLE
var/list/Lines = file2list(filename)
for(var/t in Lines)
if(!t) continue
if(!t)
continue
t = trim(t)
if (length(t) == 0)

View File

@@ -44,7 +44,8 @@ var/soft_dels = 0
var/remainingCollectionPerTick = GC_COLLECTIONS_PER_TICK
var/remainingForceDelPerTick = GC_FORCE_DEL_PER_TICK
var/collectionTimeScope = world.timeofday - GC_COLLECTION_TIMEOUT
if(narsie_cometh) return //don't even fucking bother, its over.
if(narsie_cometh)
return //don't even fucking bother, its over.
while(queue.len && --remainingCollectionPerTick >= 0)
var/refID = queue[1]
var/destroyedAtTime = queue[refID]
@@ -183,7 +184,8 @@ var/soft_dels = 0
things += thing
testing("Collected list of things in search for references to a [type]. ([things.len] Thing\s)")
for(var/datum/thing in things)
if(!usr.client.running_find_references) return
if(!usr.client.running_find_references)
return
for(var/varname in thing.vars)
var/variable = thing.vars[varname]
if(variable == src)

View File

@@ -62,8 +62,10 @@ datum/controller/game_controller/New()
// to_chat(world, "<span class='danger'>Job setup complete in </span>")
log_startup_progress("Job setup complete in [stop_watch(watch)]s.")
if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase()
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
if(!syndicate_code_phrase)
syndicate_code_phrase = generate_code_phrase()
if(!syndicate_code_response)
syndicate_code_response = generate_code_phrase()
/*if(!emergency_shuttle) emergency_shuttle = new /datum/shuttle_controller/emergency_shuttle()*/
/*
if(global.garbageCollector)
@@ -489,7 +491,8 @@ datum/controller/game_controller/recover() //Mostly a placeholder for now.
var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n"
for(var/varname in master_controller.vars)
switch(varname)
if("tag","type","parent_type","vars") continue
if("tag","type","parent_type","vars")
continue
else
var/varval = master_controller.vars[varname]
if(istype(varval,/datum))

View File

@@ -38,7 +38,8 @@ datum/shuttle_controller
// otherwise if outgoing, switch to incoming
datum/shuttle_controller/proc/incall(coeff = 1)
if(shutdown) return
if(shutdown)
return
if((!universe.OnShuttleCall(null) || deny_shuttle) && alert == 1) //crew transfer shuttle does not gets recalled by gamemode
return
if(endtime)
@@ -56,7 +57,8 @@ datum/shuttle_controller/proc/incall(coeff = 1)
A.readyalert()
datum/shuttle_controller/proc/shuttlealert(var/X)
if(shutdown) return
if(shutdown)
return
alert = X
@@ -67,8 +69,10 @@ datum/shuttle_controller/proc/force_shutdown()
datum/shuttle_controller/proc/recall()
if(shutdown) return
if(!can_recall) return
if(shutdown)
return
if(!can_recall)
return
if(direction == 1)
var/timeleft = timeleft()
if(alert == 0)

View File

@@ -6,7 +6,8 @@
set name = "Restart Controller"
set desc = "Restart one of the various periodic loop controllers for the game (be careful!)"
if(!holder) return
if(!holder)
return
usr = null
src = null
switch(controller)