return "" instead of nil
This commit is contained in:
@@ -16,6 +16,6 @@ class ConfirmingSyncPatternState < StatePattern::State
|
|||||||
end
|
end
|
||||||
|
|
||||||
# return the rest
|
# return the rest
|
||||||
return bytes[idx+1..-1]
|
return bytes[idx+1..-1] || ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -23,7 +23,7 @@ class InSyncState < StatePattern::State
|
|||||||
# p "##################"
|
# p "##################"
|
||||||
reading = handle_frame(frame_lines)
|
reading = handle_frame(frame_lines)
|
||||||
p reading
|
p reading
|
||||||
return bytes[idx+sync_pattern_length..-1]
|
return bytes[idx+sync_pattern_length..-1] || ""
|
||||||
else
|
else
|
||||||
return bytes
|
return bytes
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ class SearchingForSyncState < StatePattern::State
|
|||||||
transition_to(ConfirmingSyncPatternState)
|
transition_to(ConfirmingSyncPatternState)
|
||||||
|
|
||||||
# return
|
# return
|
||||||
return bytes[idx..-1]
|
return bytes[idx..-1] || ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user