Skip to content

Commit

Permalink
More specialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis committed May 8, 2024
1 parent 6531cfa commit 31ab32f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extension BinaryTrie {

/// If `index != nil`, resolves the `index` to a `Value`
/// This is used as a helper in `descendPath(in:parameters:components:)`
@usableFromInline
@inlinable
internal func value(for index: UInt16?, parameters: Parameters) -> (value: Value, parameters: Parameters)? {
if let index, let value = self.values[Int(index)] {
return (value: value, parameters: parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import NIOCore

extension BinaryTrie {
@usableFromInline
static func serialize(
_ node: RouterPathTrieBuilder<Value>.Node,
trie: inout ByteBuffer,
Expand Down
1 change: 1 addition & 0 deletions Sources/Hummingbird/Router/BinaryTrie/BinaryTrie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct BinaryTrieNode {
@usableFromInline
let values: [Value?]

@inlinable
@_spi(Internal) public init(base: RouterPathTrieBuilder<Value>) {
var trie = ByteBufferAllocator().buffer(capacity: 1024)
var values: [Value?] = []
Expand Down
1 change: 1 addition & 0 deletions Sources/Hummingbird/Router/TrieRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import HummingbirdCore

/// URI Path Trie Builder
@_spi(Internal) public struct RouterPathTrieBuilder<Value: Sendable> {
@usableFromInline
var root: Node

public init() {
Expand Down

0 comments on commit 31ab32f

Please sign in to comment.