Skip to content

Commit 54431ed

Browse files
committed
Slightly optimize bootstrap
1 parent 0af61bf commit 54431ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

MarkEditCore/Sources/Extensions/EditorConfig+Extension.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import Foundation
88

99
public extension EditorConfig {
1010
var toHtml: String {
11-
indexHtml?
11+
Self.indexHtml?
1212
.replacingOccurrences(of: "/chunk-loader/", with: "chunk-loader://")
1313
.replacingOccurrences(of: "\"{{EDITOR_CONFIG}}\"", with: jsonEncoded) ?? ""
1414
}
1515
}
1616

1717
extension EditorConfig {
1818
/// index.html built by CoreEditor.
19-
private var indexHtml: String? {
19+
private static let indexHtml: String? = {
2020
guard let path = Bundle.main.url(forResource: "index", withExtension: "html") else {
2121
fatalError("Missing dist/index.html to set up the editor. In the wiki, see Building CoreEditor.")
2222
}
2323

2424
return try? Data(contentsOf: path).toString()
25-
}
25+
}()
2626
}

MarkEditMac/Sources/Main/Application/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
8484
}
8585
}
8686

87-
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
87+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
8888
EditorReusePool.shared.warmUp()
8989
}
9090

0 commit comments

Comments
 (0)