Skip to content

Commit 46fba3e

Browse files
committed
stdlib: ExistentialCollection: use better names for internal methods
1 parent 35dd246 commit 46fba3e

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

stdlib/public/core/ExistentialCollection.swift.gyb

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ internal final class _IteratorBox<
115115
internal var _base: Base
116116
}
117117

118-
internal func _typeID(_ instance: AnyObject) -> ObjectIdentifier {
119-
return ObjectIdentifier(instance.dynamicType)
120-
}
121-
122118
//===--- Sequence ---------------------------------------------------------===//
123119
//===----------------------------------------------------------------------===//
124120

@@ -646,17 +642,17 @@ internal protocol _AnyIndexBox : class {
646642

647643
func _unbox<T : Comparable>() -> T?
648644

649-
func _equal(to rhs: _AnyIndexBox) -> Bool
645+
func _isEqual(to rhs: _AnyIndexBox) -> Bool
650646

651-
func _notEqual(to rhs: _AnyIndexBox) -> Bool
647+
func _isNotEqual(to rhs: _AnyIndexBox) -> Bool
652648

653-
func _less(than rhs: _AnyIndexBox) -> Bool
649+
func _isLess(than rhs: _AnyIndexBox) -> Bool
654650

655-
func _lessOrEqual(to rhs: _AnyIndexBox) -> Bool
651+
func _isLessOrEqual(to rhs: _AnyIndexBox) -> Bool
656652

657-
func _greater(than rhs: _AnyIndexBox) -> Bool
653+
func _isGreater(than rhs: _AnyIndexBox) -> Bool
658654

659-
func _greaterOrEqual(to rhs: _AnyIndexBox) -> Bool
655+
func _isGreaterOrEqual(to rhs: _AnyIndexBox) -> Bool
660656
}
661657

662658
internal final class _IndexBox<
@@ -673,34 +669,34 @@ internal final class _IndexBox<
673669
}
674670

675671
internal var _typeID: ObjectIdentifier {
676-
return Swift._typeID(self)
672+
return ObjectIdentifier(self.dynamicType)
677673
}
678674

679675
internal func _unbox<T : Comparable>() -> T? {
680676
return (self as _AnyIndexBox as? _IndexBox<T>)?._base
681677
}
682678

683-
internal func _equal(to rhs: _AnyIndexBox) -> Bool {
679+
internal func _isEqual(to rhs: _AnyIndexBox) -> Bool {
684680
return _base == _unsafeUnbox(rhs)
685681
}
686682

687-
internal func _notEqual(to rhs: _AnyIndexBox) -> Bool {
683+
internal func _isNotEqual(to rhs: _AnyIndexBox) -> Bool {
688684
return _base != _unsafeUnbox(rhs)
689685
}
690686

691-
internal func _less(than rhs: _AnyIndexBox) -> Bool {
687+
internal func _isLess(than rhs: _AnyIndexBox) -> Bool {
692688
return _base < _unsafeUnbox(rhs)
693689
}
694690

695-
internal func _lessOrEqual(to rhs: _AnyIndexBox) -> Bool {
691+
internal func _isLessOrEqual(to rhs: _AnyIndexBox) -> Bool {
696692
return _base <= _unsafeUnbox(rhs)
697693
}
698694

699-
internal func _greater(than rhs: _AnyIndexBox) -> Bool {
695+
internal func _isGreater(than rhs: _AnyIndexBox) -> Bool {
700696
return _base > _unsafeUnbox(rhs)
701697
}
702698

703-
internal func _greaterOrEqual(to rhs: _AnyIndexBox) -> Bool {
699+
internal func _isGreaterOrEqual(to rhs: _AnyIndexBox) -> Bool {
704700
return _base >= _unsafeUnbox(rhs)
705701
}
706702
}
@@ -732,32 +728,32 @@ public struct AnyIndex : Comparable {
732728
/// identical.
733729
public func == (lhs: AnyIndex, rhs: AnyIndex) -> Bool {
734730
_precondition(lhs._typeID == rhs._typeID, "base index types differ")
735-
return lhs._box._equal(to: rhs._box)
731+
return lhs._box._isEqual(to: rhs._box)
736732
}
737733

738734
public func != (lhs: AnyIndex, rhs: AnyIndex) -> Bool {
739735
_precondition(lhs._typeID == rhs._typeID, "base index types differ")
740-
return lhs._box._notEqual(to: rhs._box)
736+
return lhs._box._isNotEqual(to: rhs._box)
741737
}
742738

743739
public func < (lhs: AnyIndex, rhs: AnyIndex) -> Bool {
744740
_precondition(lhs._typeID == rhs._typeID, "base index types differ")
745-
return lhs._box._less(than: rhs._box)
741+
return lhs._box._isLess(than: rhs._box)
746742
}
747743

748744
public func <= (lhs: AnyIndex, rhs: AnyIndex) -> Bool {
749745
_precondition(lhs._typeID == rhs._typeID, "base index types differ")
750-
return lhs._box._lessOrEqual(to: rhs._box)
746+
return lhs._box._isLessOrEqual(to: rhs._box)
751747
}
752748

753749
public func > (lhs: AnyIndex, rhs: AnyIndex) -> Bool {
754750
_precondition(lhs._typeID == rhs._typeID, "base index types differ")
755-
return lhs._box._greater(than: rhs._box)
751+
return lhs._box._isGreater(than: rhs._box)
756752
}
757753

758754
public func >= (lhs: AnyIndex, rhs: AnyIndex) -> Bool {
759755
_precondition(lhs._typeID == rhs._typeID, "base index types differ")
760-
return lhs._box._greaterOrEqual(to: rhs._box)
756+
return lhs._box._isGreaterOrEqual(to: rhs._box)
761757
}
762758

763759
//===--- Collections ------------------------------------------------------===//

0 commit comments

Comments
 (0)