From 32fd0cfa25bbb010e699703d273a013e81469d0e Mon Sep 17 00:00:00 2001 From: Michael Ilseman Date: Mon, 27 Jan 2020 11:39:34 -0800 Subject: [PATCH] WIP: Demonstrate dropping count field from FixedArray --- stdlib/public/core/FixedArray.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/stdlib/public/core/FixedArray.swift b/stdlib/public/core/FixedArray.swift index ef864a4329081..7481a683babb1 100644 --- a/stdlib/public/core/FixedArray.swift +++ b/stdlib/public/core/FixedArray.swift @@ -24,7 +24,7 @@ internal struct _FixedArray16 { T, T, T, T, T, T, T, T ) - var _count: Int8 +// var _count: Int8 } extension _FixedArray16 { @@ -37,8 +37,8 @@ extension _FixedArray16 { } internal var count: Int { - @inline(__always) get { return Int(truncatingIfNeeded: _count) } - @inline(__always) set { _count = Int8(newValue) } + @inline(__always) get { return 16 } // Int(truncatingIfNeeded: _count) } +// @inline(__always) set { _count = Int8(newValue) } } } @@ -90,11 +90,11 @@ extension _FixedArray16: RandomAccessCollection, MutableCollection { } extension _FixedArray16 { - internal mutating func append(_ newElement: T) { - _internalInvariant(count < capacity) - _count += 1 - self[count-1] = newElement - } + // internal mutating func append(_ newElement: T) { + // _internalInvariant(count < capacity) + // _count += 1 + // self[count-1] = newElement + // } } extension _FixedArray16 where T: ExpressibleByIntegerLiteral { @@ -105,7 +105,7 @@ extension _FixedArray16 where T: ExpressibleByIntegerLiteral { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) - self._count = Int8(truncatingIfNeeded: count) + // self._count = Int8(truncatingIfNeeded: count) } @inline(__always)