Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 66c84b1

Browse files
committed
Add link to LineReader implementations
1 parent 2541455 commit 66c84b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/GitHub.Exports/Models/DiffUtilities.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ public static DiffLine Match(IEnumerable<DiffChunk> diff, IList<DiffLine> target
115115
return null;
116116
}
117117

118+
/// Here are some alternative implementations we tried:
119+
/// https://gist.github.com/shana/200e4719d4f571caab9dbf5921fa5276
120+
/// Scanning with `text.IndexOf('\n', index)` appears to the the best compromise for average .diff files.
121+
/// It's likely that `text.IndexOfAny(new [] {'\r', '\n'}, index)` would be faster if lines were much longer.
118122
public class LineReader
119123
{
120124
readonly string text;

0 commit comments

Comments
 (0)