Skip to content

Commit 50e88f6

Browse files
committed
Prefer direct Hash access
Since we've already confirmed the key exists with we can safely use `@styles[style_name]` instead of `@styles.fetch(style_name)` for direct hash access.
1 parent a3e3552 commit 50e88f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/components/flowbite/styles.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def add_style(style_name, states_hash)
1919
end
2020

2121
def fetch(style_name)
22-
return @styles.fetch(style_name) if @styles.key?(style_name)
22+
return @styles[style_name] if @styles.key?(style_name)
2323

2424
raise \
2525
StyleNotFoundError,

0 commit comments

Comments
 (0)