Commit e3eb21a
util: remove duplicate code in format
util.format contains an idential if statement within each branch
of switch. Move it before the switch statement for cleaner code
and better performance.
PR-URL: nodejs/node#15098
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>1 parent dfb8b9b commit e3eb21a
1 file changed
Lines changed: 2 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | | - | |
117 | | - | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
126 | | - | |
127 | | - | |
128 | 124 | | |
129 | 125 | | |
130 | 126 | | |
131 | | - | |
132 | | - | |
133 | 127 | | |
134 | 128 | | |
135 | 129 | | |
136 | | - | |
137 | | - | |
138 | 130 | | |
139 | 131 | | |
140 | 132 | | |
141 | | - | |
142 | | - | |
143 | 133 | | |
144 | 134 | | |
145 | 135 | | |
146 | | - | |
147 | | - | |
148 | 136 | | |
149 | 137 | | |
150 | 138 | | |
151 | 139 | | |
152 | | - | |
153 | | - | |
154 | 140 | | |
155 | 141 | | |
156 | 142 | | |
157 | | - | |
158 | | - | |
159 | 143 | | |
160 | 144 | | |
161 | 145 | | |
| |||
0 commit comments