Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitbourahlavignal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIGNAL Nicolas
gitbourahlavignal
Commits
032e8247
Commit
032e8247
authored
7 years ago
by
Francis Luong (Franco)
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #86 from koic/integer_unification
Integer Unification for Ruby 2.4.0+
parents
580edc4a
fd5b2e0e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ipaddress/prefix.rb
+4
-4
4 additions, 4 deletions
lib/ipaddress/prefix.rb
with
4 additions
and
4 deletions
lib/ipaddress/prefix.rb
+
4
−
4
View file @
032e8247
...
@@ -55,10 +55,10 @@ module IPAddress
...
@@ -55,10 +55,10 @@ module IPAddress
#
#
# Sums two prefixes or a prefix to a
# Sums two prefixes or a prefix to a
# number, returns a
Fixnum
# number, returns a
Integer
#
#
def
+
(
oth
)
def
+
(
oth
)
if
oth
.
is_a?
Fixnum
if
oth
.
is_a?
Integer
self
.
prefix
+
oth
self
.
prefix
+
oth
else
else
self
.
prefix
+
oth
.
prefix
self
.
prefix
+
oth
.
prefix
...
@@ -68,10 +68,10 @@ module IPAddress
...
@@ -68,10 +68,10 @@ module IPAddress
#
#
# Returns the difference between two
# Returns the difference between two
# prefixes, or a prefix and a number,
# prefixes, or a prefix and a number,
# as a
Fixnum
# as a
Integer
#
#
def
-
(
oth
)
def
-
(
oth
)
if
oth
.
is_a?
Fixnum
if
oth
.
is_a?
Integer
self
.
prefix
-
oth
self
.
prefix
-
oth
else
else
(
self
.
prefix
-
oth
.
prefix
).
abs
(
self
.
prefix
-
oth
.
prefix
).
abs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment