Skip to content

Commit

Permalink
[Web] Reflect Azure storage account migration
Browse files Browse the repository at this point in the history
  • Loading branch information
burkenyo committed Aug 12, 2024
1 parent 5966927 commit c6034da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
2 changes: 1 addition & 1 deletion api/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"ASPNETCORE_ENVIRONMENT": "Development",
//"UseFileStore": "true",
"FileStore:DataDirectory": "${workspaceFolder}/data",
"Azure:Blobs:AccountName": "roflninjastorage",
"Azure:Blobs:AccountName": "orangewave",
"Azure:Blobs:ContainerName": "sammo-ga"
},
"sourceFileMap": {
Expand Down
10 changes: 5 additions & 5 deletions api/Sammo.Oeis.Playground/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright © 2023 Samuel Justin Gabay
// Licensed under the GNU Affero Public License, Version 3

// Copyright © 2023 Samuel Justin Gabay
// Licensed under the GNU Affero Public License, Version 3

using System.Diagnostics;
using System.Reflection;
using System.Text.Json;
Expand Down Expand Up @@ -109,11 +109,11 @@ static DirectoryInfo GetDataDirectory()

static BlobContainerClient GetContainerClient()
{
const string accountName = "roflninjastorage";
const string accountName = "orangewave";
const string containerName = "sammo-ga";

var containerUri = new Uri($"https://{accountName}.blob.core.windows.net/{containerName}");

return new BlobContainerClient(containerUri, new DefaultAzureCredential());
}
}
}
23 changes: 5 additions & 18 deletions api/Sammo.Oeis/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,20 @@ static class BufferUtils
public const int MaxStackAllocChars = MaxStackAllocBytes / sizeof(char);
}

[InlineArray(BufferUtils.MaxStackAllocBytes)]
[InlineArray(Capacity)]
struct ByteBuffer
{
byte _;

public int Length =>
AsSpan().Length;

[UnscopedRef]
public Span<byte> AsSpan() =>
this;
public const int Capacity = BufferUtils.MaxStackAllocBytes;
}

[InlineArray(BufferUtils.MaxStackAllocChars)]
[InlineArray(Capacity)]
struct CharBuffer
{
char _;

public int Length =>
AsSpan().Length;

[UnscopedRef]
public Span<char> AsSpan() =>
this;
public const int Capacity = BufferUtils.MaxStackAllocChars;
}

ref struct StackStringBuilder
Expand All @@ -75,11 +65,8 @@ ref struct StackStringBuilder

public int Position { get; private set; }

public int Capacity =>
_buffer.Length;

public int RemainingCapacity =>
Capacity - Position;
CharBuffer.Capacity - Position;

public void Append(ReadOnlySpan<char> value)
{
Expand Down

0 comments on commit c6034da

Please sign in to comment.