Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Removed fully qualified Position names
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofCwalina committed Dec 22, 2017
1 parent db8e98e commit 2f0d92d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Buffers;
using System.Collections.Sequences;
using Position = System.Collections.Sequences.Position;

namespace Microsoft.Net
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Buffers;
using System.Buffers.Text;
using System.Collections.Sequences;
using Position = System.Collections.Sequences.Position;

namespace System.Text.Formatting
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Buffers;
using System.Buffers.Text;
using System.Collections.Sequences;
using Position = System.Collections.Sequences.Position;

namespace System.Text.Parsing
{
Expand Down
18 changes: 9 additions & 9 deletions tests/Benchmarks/HttpParserBench.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ static bool RequestLineRobCursors()
var buffer = new ReadOnlyBytes(s_plaintextTechEmpowerRequestBytes);
var parser = new HttpParser();
var request = new Request();
System.Collections.Sequences.Position consumed = default;
System.Collections.Sequences.Position read;
Position consumed = default;
Position read;
bool success = true;

foreach (var iteration in Benchmark.Iterations)
Expand Down Expand Up @@ -168,8 +168,8 @@ static bool HeadersRobCursors()
var buffer = new ReadOnlyBytes(s_plaintextTechEmpowerHeadersBytes);
var parser = new HttpParser();
var request = new Request();
System.Collections.Sequences.Position consumed = default;
System.Collections.Sequences.Position examined;
Position consumed = default;
Position examined;
int consumedBytes;
bool success = true;

Expand Down Expand Up @@ -324,8 +324,8 @@ static bool FullRequestRobCursors()
var buffer = new ReadOnlyBytes(s_plaintextTechEmpowerRequestBytes);
var parser = new HttpParser();
var request = new RequestStruct();
System.Collections.Sequences.Position consumed = default;
System.Collections.Sequences.Position examined;
Position consumed = default;
Position examined;
bool success = true;

foreach (var iteration in Benchmark.Iterations)
Expand All @@ -349,7 +349,7 @@ static bool FullRequestRobCursors()

static class HttpParserExtensions
{
public static bool ParseRequestLine<T>(this HttpParser parser, ref T handler, in ReadOnlyBytes buffer, out System.Collections.Sequences.Position consumed, out System.Collections.Sequences.Position examined) where T : IHttpRequestLineHandler
public static bool ParseRequestLine<T>(this HttpParser parser, ref T handler, in ReadOnlyBytes buffer, out Position consumed, out Position examined) where T : IHttpRequestLineHandler
{
if(parser.ParseRequestLine(ref handler, buffer, out int consumedBytes))
{
Expand All @@ -362,7 +362,7 @@ public static bool ParseRequestLine<T>(this HttpParser parser, ref T handler, in
return false;
}

public static bool ParseHeaders<T>(this HttpParser parser, ref T handler, in ReadOnlyBytes buffer, out System.Collections.Sequences.Position consumed, out System.Collections.Sequences.Position examined, out int consumedBytes) where T : IHttpHeadersHandler
public static bool ParseHeaders<T>(this HttpParser parser, ref T handler, in ReadOnlyBytes buffer, out Position consumed, out Position examined, out int consumedBytes) where T : IHttpHeadersHandler
{
if (parser.ParseHeaders(ref handler, buffer, out consumedBytes))
{
Expand All @@ -375,7 +375,7 @@ public static bool ParseHeaders<T>(this HttpParser parser, ref T handler, in Rea
return false;
}

public static bool ParseRequest<T>(this HttpParser parser, ref T handler, in ReadOnlyBytes buffer, out System.Collections.Sequences.Position consumed, out System.Collections.Sequences.Position examined) where T : IHttpRequestLineHandler, IHttpHeadersHandler
public static bool ParseRequest<T>(this HttpParser parser, ref T handler, in ReadOnlyBytes buffer, out Position consumed, out Position examined) where T : IHttpRequestLineHandler, IHttpHeadersHandler
{
if (
parser.ParseRequestLine(ref handler, buffer, out var consumedRLBytes) &&
Expand Down

0 comments on commit 2f0d92d

Please sign in to comment.