Skip to content

Commit

Permalink
remove some unnecessary string overloads (#77)
Browse files Browse the repository at this point in the history
* remove some unnecessary `string` overloads

* test updating invalidation script
  • Loading branch information
KristofferC authored Jul 12, 2024
1 parent 36839e5 commit d54fa1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/Invalidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
id: invs_default

- name: Report invalidation counts
run: |
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
- name: Check if the PR does increase number of invalidations
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
run: exit 1
run: |
if [ ${{ steps.invs_pr.outputs.total }} -gt ${{ steps.invs_default.outputs.total }} ]; then
exit 1
fi
6 changes: 2 additions & 4 deletions src/InlineStrings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -613,13 +613,11 @@ end
return n
end

const BaseStrs = Union{Char, String, SubString{String}}

Base.string(a::InlineString) = a
Base.string(a::InlineString...) = _string(a...)
Base.string(a::BaseStrs, b::InlineString) = _string(a, b)
Base.string(a::BaseStrs, b::BaseStrs, c::InlineString) = _string(a, b, c)

@inline function _string(a::Union{BaseStrs, InlineString}...)
@inline function _string(a::InlineString...)
n = 0
for v in a
if v isa Char
Expand Down

0 comments on commit d54fa1b

Please sign in to comment.