lib/rufus/sc/jobqueues.rb in rufus-scheduler-2.0.7 vs lib/rufus/sc/jobqueues.rb in rufus-scheduler-2.0.8
- old
+ new
@@ -1,7 +1,7 @@
#--
-# Copyright (c) 2006-2010, John Mettraux, jmettraux@gmail.com
+# Copyright (c) 2006-2011, John Mettraux, jmettraux@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -101,11 +101,12 @@
protected
def delete(job_id)
- j = @jobs.find { |j| j.job_id == job_id }
- @jobs.delete(j) if j
+ if job = @jobs.find { |j| j.job_id == job_id }
+ @jobs.delete(job)
+ end
end
# Returns the next job to trigger. Returns nil if none eligible.
#
def job_to_trigger(now)