From 81736c6abf0746c64fd0f88e4af0b2bbf98e6ba9 Mon Sep 17 00:00:00 2001 From: Sean Proctor Date: Fri, 20 Dec 2024 09:08:10 -0500 Subject: [PATCH] remove unnecessary non-null coercions (due to k2 improvements) --- .../warlockfe/warlock3/scripting/wsl/WslCommands.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripting/src/main/kotlin/warlockfe/warlock3/scripting/wsl/WslCommands.kt b/scripting/src/main/kotlin/warlockfe/warlock3/scripting/wsl/WslCommands.kt index 719d255..865e0ed 100644 --- a/scripting/src/main/kotlin/warlockfe/warlock3/scripting/wsl/WslCommands.kt +++ b/scripting/src/main/kotlin/warlockfe/warlock3/scripting/wsl/WslCommands.kt @@ -1,12 +1,12 @@ package warlockfe.warlock3.scripting.wsl -import warlockfe.warlock3.core.text.WarlockColor +import kotlinx.coroutines.delay import warlockfe.warlock3.core.text.StyleDefinition +import warlockfe.warlock3.core.text.WarlockColor import warlockfe.warlock3.core.util.CaseInsensitiveMap import warlockfe.warlock3.core.util.findArgumentBreak import warlockfe.warlock3.core.util.parseArguments import warlockfe.warlock3.core.util.toWarlockColor -import kotlinx.coroutines.delay import warlockfe.warlock3.scripting.util.ScriptLoggingLevel import java.math.BigDecimal import kotlin.random.Random @@ -67,7 +67,7 @@ val wslCommands = CaseInsensitiveMap Unit>( throw WslRuntimeException("\"string\" must be specified for AddToHighlightStrings") } context.addHighlight( - pattern = pattern!!, + pattern = pattern, style = StyleDefinition( textColor = textColor ?: WarlockColor.Unspecified, backgroundColor = backgroundColor ?: WarlockColor.Unspecified, @@ -134,7 +134,7 @@ val wslCommands = CaseInsensitiveMap Unit>( if (pattern == null) { throw WslRuntimeException("\"string\" must be specified for DeleteFromHighlightStrings") } - context.deleteHighlight(pattern = pattern!!) + context.deleteHighlight(pattern = pattern) }, "deletevariable" to { context, args -> val (name, _) = args.splitFirstWord()