Skip to content

Commit 37693fd

Browse files
committed
Lint
1 parent 593fd5d commit 37693fd

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/main/ruby/core/process.rb

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,30 +117,30 @@ def self.time
117117

118118
def self.clock_getres(id, unit=:float_second)
119119
res = case id
120-
when :MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC,
121-
CLOCK_MONOTONIC
122-
1
123-
when :GETTIMEOFDAY_BASED_CLOCK_REALTIME,
124-
:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID,
125-
:CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID
126-
1_000
127-
when CLOCK_REALTIME
128-
1_000_000
129-
when :TIMES_BASED_CLOCK_MONOTONIC,
130-
:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID
131-
10_000_000
132-
when :TIME_BASED_CLOCK_REALTIME
133-
1_000_000_000
134-
when Symbol
135-
raise Errno::EINVAL
136-
else
137-
_res = Truffle::POSIX.truffleposix_clock_getres(id)
138-
if _res == 0 then
139-
Errno.handle
140-
else
141-
_res
142-
end
143-
end
120+
when :MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC,
121+
CLOCK_MONOTONIC
122+
1
123+
when :GETTIMEOFDAY_BASED_CLOCK_REALTIME,
124+
:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID,
125+
:CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID
126+
1_000
127+
when CLOCK_REALTIME
128+
1_000_000
129+
when :TIMES_BASED_CLOCK_MONOTONIC,
130+
:TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID
131+
10_000_000
132+
when :TIME_BASED_CLOCK_REALTIME
133+
1_000_000_000
134+
when Symbol
135+
raise Errno::EINVAL
136+
else
137+
res_for_id = Truffle::POSIX.truffleposix_clock_getres(id)
138+
if res_for_id == 0 then
139+
Errno.handle
140+
else
141+
res_for_id
142+
end
143+
end
144144

145145
if :hertz == unit then
146146
1.0 / nanoseconds_to_unit(res,:float_second)

0 commit comments

Comments
 (0)