Skip to content

Commit

Permalink
Correct typos throughout the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Dec 20, 2020
1 parent cf9c261 commit 38d1676
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions spec/std/log/metadata_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ describe Log::Metadata do

md.@size.should eq(1)
md.@max_total_size.should eq(4)
md.@overriden_size.should eq(1)
md.@overridden_size.should eq(1)
md.@parent.should be(parent)

md.should eq(m({a: 3, b: 2}))

md.@size.should eq(2)
md.@max_total_size.should eq(2)
md.@overriden_size.should eq(1)
md.@overridden_size.should eq(1)
md.@parent.should be_nil
end

Expand Down
2 changes: 1 addition & 1 deletion src/array.cr
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Array(T)
# The capacity of `@buffer`.
# Note that, because `@buffer` moves on shift, the actual
# capacity (the allocated memory) starts at `@buffer - @offset_to_buffer`.
# The actualy capacity is also given by the `remaining_capacity` internal method.
# The actual capacity is also given by the `remaining_capacity` internal method.
@capacity : Int32

# Offset to the buffer that was originally allocated, and which needs to
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/syntax/ast.cr
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module Crystal
end

# It yields `nil` always.
# (It is overriden by `Expressions` to implement `#single_expression`.)
# (It is overridden by `Expressions` to implement `#single_expression`.)
def single_expression?
nil
end
Expand Down
22 changes: 11 additions & 11 deletions src/log/metadata.cr
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class Log::Metadata
# When the metadata is defragmented max_total_size will be updated with size
protected getter max_total_size : Int32
@max_total_size = uninitialized Int32
# How many entries are potentially overriden from parent (ie: initial entries.size)
@overriden_size = uninitialized Int32
# How many entries are potentially overridden from parent (ie: initial entries.size)
@overridden_size = uninitialized Int32
# How many entries are stored from @first.
# Initially are @overriden_size, the one explicitly overriden in entries argument.
# Initially are @overridden_size, the one explicitly overridden in entries argument.
# When the metadata is defragmented @size will be increased up to
# the actual number of entries resulting from merging the parent
@size = uninitialized Int32
Expand All @@ -38,7 +38,7 @@ class Log::Metadata
end

protected def setup(@parent : Metadata?, entries : NamedTuple | Hash)
@size = @overriden_size = entries.size
@size = @overridden_size = entries.size
@max_total_size = @size + (@parent.try(&.max_total_size) || 0)
ptr_entries = pointerof(@first)

Expand Down Expand Up @@ -87,26 +87,26 @@ class Log::Metadata
# will be recomputed, but the result should be the same.
#
# * @parent.nil? signals if the defrag is needed/done
# * The values of @overriden_size, pointerof(@first) are never changed
# * The values of @overridden_size, pointerof(@first) are never changed
# * @parent is set at the very end of the method
protected def defrag
parent = @parent
return if parent.nil?

total_size = @overriden_size
total_size = @overridden_size
ptr_entries = pointerof(@first)
next_free_entry = ptr_entries + @overriden_size
next_free_entry = ptr_entries + @overridden_size

parent.each do |(key, value)|
overriden = false
@overriden_size.times do |i|
overridden = false
@overridden_size.times do |i|
if ptr_entries[i][:key] == key
overriden = true
overridden = true
break
end
end

unless overriden
unless overridden
next_free_entry.value = {key: key, value: value}
next_free_entry += 1
total_size += 1
Expand Down
4 changes: 2 additions & 2 deletions src/system_error.cr
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module SystemError
# Create an instance of the exception that wraps a system error
#
# This is a factory method and by default it creates an instance
# of the current class. It can be overriden to generate different
# of the current class. It can be overridden to generate different
# classes based on the `errno` or keyword arguments.
protected def new_from_errno(message : String, errno : Errno, **opts)
self.new(message, **opts)
Expand Down Expand Up @@ -91,7 +91,7 @@ module SystemError
# Create an instance of the exception that wraps a system error
#
# This is a factory method and by default it creates an instance
# of the current class. It can be overriden to generate different
# of the current class. It can be overridden to generate different
# classes based on the `winerror` or keyword arguments.
protected def new_from_winerror(message : String, winerror : WinError, **opts)
new_from_errno(message, winerror.to_errno, **opts)
Expand Down

0 comments on commit 38d1676

Please sign in to comment.