From a42fc9fcbe679ba3a40fbaf66934dac79b0965de Mon Sep 17 00:00:00 2001 From: Joannis Orlandos Date: Sun, 28 Oct 2018 16:14:28 +0100 Subject: [PATCH] Remove irrelevant todos --- Sources/BSON/Document/Document+Cache.swift | 1 + Sources/BSON/Document/Document+Mutations.swift | 2 -- Sources/BSON/Types/Primitives.swift | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/BSON/Document/Document+Cache.swift b/Sources/BSON/Document/Document+Cache.swift index fb09bef..6cbdc01 100644 --- a/Sources/BSON/Document/Document+Cache.swift +++ b/Sources/BSON/Document/Document+Cache.swift @@ -289,6 +289,7 @@ extension Document { return nil } + // Omit the null terminator as we don't use/need that in Swift return self.storage.getString(at: offset &+ 4, length: numericCast(length) - 1) case .binary: guard let length = self.storage.getInteger(at: offset, endianness: .little, as: Int32.self) else { diff --git a/Sources/BSON/Document/Document+Mutations.swift b/Sources/BSON/Document/Document+Mutations.swift index 5956cb3..2c97787 100644 --- a/Sources/BSON/Document/Document+Mutations.swift +++ b/Sources/BSON/Document/Document+Mutations.swift @@ -155,9 +155,7 @@ extension Document { storage.write(string: regex.options) storage.write(integer: 0x00, endianness: .little, as: UInt8.self) // 0x0C is deprecated (DBPointer) - // TODO: JavascriptCode (0x0D) // 0x0E is deprecated (Symbol) - // TODO: JavascriptCode With Scope (0x0F) case let int as Int32: // 0x10 prepareWritingPrimitive(.int32, bodyLength: 4, existingDimensions: dimensions, key: key) storage.write(integer: int, endianness: .little) diff --git a/Sources/BSON/Types/Primitives.swift b/Sources/BSON/Types/Primitives.swift index 86f465d..5ce1573 100644 --- a/Sources/BSON/Types/Primitives.swift +++ b/Sources/BSON/Types/Primitives.swift @@ -2,7 +2,6 @@ import Foundation public protocol Primitive: Codable, PrimitiveConvertible {} -// TODO: Investigate if this protocol is needed internal protocol BSONDataType: Primitive { var primitive: Primitive { get } init(primitive: Primitive?) throws