File tree 1 file changed +6
-5
lines changed 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ def initialize(binstr = nil)
9
9
@mtime = nil
10
10
@atime = nil
11
11
@flag = 0
12
- binstr && merge ( binstr )
12
+
13
+ merge ( binstr ) unless binstr . nil?
13
14
end
14
15
15
16
attr_reader :atime , :ctime , :mtime , :flag
@@ -63,15 +64,15 @@ def ==(other)
63
64
64
65
def pack_for_local
65
66
s = [ @flag ] . pack ( 'C' )
66
- @flag & 1 != 0 && s << [ @mtime . to_i ] . pack ( 'l<' )
67
- @flag & 2 != 0 && s << [ @atime . to_i ] . pack ( 'l<' )
68
- @flag & 4 != 0 && s << [ @ctime . to_i ] . pack ( 'l<' )
67
+ s << [ @mtime . to_i ] . pack ( 'l<' ) unless @flag & 1 == 0
68
+ s << [ @atime . to_i ] . pack ( 'l<' ) unless @flag & 2 == 0
69
+ s << [ @ctime . to_i ] . pack ( 'l<' ) unless @flag & 4 == 0
69
70
s
70
71
end
71
72
72
73
def pack_for_c_dir
73
74
s = [ @flag ] . pack ( 'C' )
74
- @flag & 1 == 1 && s << [ @mtime . to_i ] . pack ( 'l<' )
75
+ s << [ @mtime . to_i ] . pack ( 'l<' ) unless @flag & 1 == 0
75
76
s
76
77
end
77
78
end
You can’t perform that action at this time.
0 commit comments