Skip to content

Commit 7ba8f03

Browse files
committed
chore: micro optimization of Route.hasEndingSlash
1 parent 06654ae commit 7ba8f03

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/SimpleW/SimpleW/Route.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public partial class Route {
3636
/// <summary>
3737
/// Return true if RawURL ending with "/"
3838
/// </summary>
39-
public bool hasEndingSlash => RawUrl.EndsWith("/");
39+
public bool hasEndingSlash => !string.IsNullOrEmpty(RawUrl) && RawUrl[^1] == '/';
4040

4141
/// <summary>
4242
/// The ControllerMethodExecutor

0 commit comments

Comments
 (0)