Skip to content

Commit 509a71c

Browse files
committed
⚡️ Reorder resp-text-code case stmt for speed
Move the codes that represent error conditions or are uncommon to the end. Any "better" ordering requires more statistics on how common each case is executed in common scenarios.
1 parent e366c3a commit 509a71c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/net/imap/response_parser.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,16 +1498,16 @@ def resp_text_code
14981498
name = resp_text_code__name
14991499
data =
15001500
case name
1501-
when "ALERT", "PARSE", "READ-ONLY", "READ-WRITE", "TRYCREATE"
1502-
when "NOMODSEQ" # CONDSTORE
1503-
when "BADCHARSET" then charset_list
15041501
when "CAPABILITY" then capability__list
15051502
when "PERMANENTFLAGS" then SP!; flag_list
15061503
when "UIDVALIDITY" then SP!; number
15071504
when "UIDNEXT" then SP!; number
15081505
when "UNSEEN" then SP!; number
15091506
when "APPENDUID" then resp_code_apnd__data
15101507
when "COPYUID" then resp_code_copy__data
1508+
when "BADCHARSET" then charset_list
1509+
when "ALERT", "PARSE", "READ-ONLY", "READ-WRITE", "TRYCREATE"
1510+
when "NOMODSEQ" # CONDSTORE
15111511
else
15121512
SP? and text_chars_except_rbra
15131513
end

0 commit comments

Comments
 (0)