File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/ImageSharp/Formats/Jpeg/Components Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 22// Licensed under the Apache License, Version 2.0.
33
44using System ;
5+ using System . Runtime . CompilerServices ;
56using System . Runtime . InteropServices ;
67using SixLabors . ImageSharp . Memory ;
78
@@ -39,6 +40,7 @@ public RowOctet(Buffer2D<T> buffer, int startY)
3940
4041 public Span < T > this [ int y ]
4142 {
43+ [ MethodImpl ( InliningOptions . ShortMethod ) ]
4244 get
4345 {
4446 // No unsafe tricks, since Span<T> can't be used as a generic argument
@@ -52,9 +54,15 @@ public Span<T> this[int y]
5254 5 => this . row5 ,
5355 6 => this . row6 ,
5456 7 => this . row7 ,
55- _ => throw new IndexOutOfRangeException ( )
57+ _ => ThrowIndexOutOfRangeException ( )
5658 } ;
5759 }
5860 }
61+
62+ [ MethodImpl ( InliningOptions . ColdPath ) ]
63+ private static Span < T > ThrowIndexOutOfRangeException ( )
64+ {
65+ throw new IndexOutOfRangeException ( ) ;
66+ }
5967 }
6068}
You can’t perform that action at this time.
0 commit comments