1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-11 09:28:38 +00:00

disable parse with comments now, need improve speed loading for JSONC

This commit is contained in:
Toxblh 2018-04-22 23:34:32 +01:00
parent 651d883672
commit 719a212913

View File

@ -3,7 +3,9 @@ import AppKit
extension Data { extension Data {
func barItemDefinitions() -> [BarItemDefinition]? { func barItemDefinitions() -> [BarItemDefinition]? {
return try? JSONDecoder().decode([BarItemDefinition].self, from: self.utf8string!.stripComments().data(using: .utf8)!) // TODO: Need improve a speed, very low loading JSON with comments ~20sec
// return try? JSONDecoder().decode([BarItemDefinition].self, from: self.utf8string!.stripComments().data(using: .utf8)!
return try? JSONDecoder().decode([BarItemDefinition].self, from: self)
} }
} }