Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in CA1846 description #6968

Merged
merged 2 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@
<value>'Buffer.BlockCopy' expects the number of bytes to be copied for the 'count' argument. Using 'Array.Length' may not match the number of bytes that needs to be copied.</value>
</data>
<data name="PreferAsSpanOverSubstringDescription" xml:space="preserve">
<value>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</value>
<value>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</value>
</data>
<data name="PreferAsSpanOverSubstringMessage" xml:space="preserve">
<value>Prefer 'AsSpan' over 'Substring' when span-based overloads are available</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Obecné přetypování (IL unbox.any) používané sekvencí vrácenou metodou E
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">AsSpan je efektivnější než Substring. Substring provádí kopírování řetězce O(n), zatímco AsSpan ho neprovádí a má konstantní náklady.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">AsSpan je efektivnější než Substring. Substring provádí kopírování řetězce O(n), zatímco AsSpan ho neprovádí a má konstantní náklady.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Erweiterungen und benutzerdefinierte Konvertierungen werden bei generischen Type
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">"AsSpan" ist effizienter als "Substring". Im Gegensatz zu "Substring" führt "AsSpan" keine O(n)-Zeichenfolgenkopie durch und bietet daher konstante Kosten.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">"AsSpan" ist effizienter als "Substring". Im Gegensatz zu "Substring" führt "AsSpan" keine O(n)-Zeichenfolgenkopie durch und bietet daher konstante Kosten.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ La ampliación y las conversiones definidas por el usuario no se admiten con tip
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">'AsSpan' es más eficaz que 'Substring'. 'Substring' realiza una copia de cadena O(n), mientras que 'AsSpan' no lo hace y tiene un costo constante.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">'AsSpan' es más eficaz que 'Substring'. 'Substring' realiza una copia de cadena O(n), mientras que 'AsSpan' no lo hace y tiene un costo constante.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Les conversions étendues et définies par l’utilisateur ne sont pas prises en
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">« AsSpan » est plus efficace, « SUBSTRING ». 'Substring’ effectue une copie de chaîne O (n), alors que ’AsSpan’ ne possède pas un coût constant.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">« AsSpan » est plus efficace, « SUBSTRING ». 'Substring’ effectue une copie de chaîne O (n), alors que ’AsSpan’ ne possède pas un coût constant.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ L'ampliamento e le conversioni definite dall'utente non sono supportate con tipi
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">'AsSpan' è più efficace di 'Substring'. 'Substring' esegue una copia della stringa O(n), mentre 'AsSpan' non la esegue e ha un costo costante.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">'AsSpan' è più efficace di 'Substring'. 'Substring' esegue una copia della stringa O(n), mentre 'AsSpan' non la esegue e ha un costo costante.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Enumerable.OfType&lt;T&gt; で使用されるジェネリック型チェック (
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">'AsSpan' の方が 'Substring' より効率的です。'Substring' は O(n) 文字列コピーを実行しますが、'AsSpan' はこれを実行せず、固定コストがあります。</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">'AsSpan' の方が 'Substring' より効率的です。'Substring' は O(n) 文字列コピーを実行しますが、'AsSpan' はこれを実行せず、固定コストがあります。</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Enumerable.OfType&lt;T&gt;에서 사용하는 제네릭 형식 검사(C# 'is'
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">'AsSpan'은 'Substring'보다 효율적입니다. 'Substring'은 O(n) 문자열 복사를 수행하는 반면 'AsSpan'은 수행하지 않으며 일정한 비용이 듭니다.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">'AsSpan'은 'Substring'보다 효율적입니다. 'Substring'은 O(n) 문자열 복사를 수행하는 반면 'AsSpan'은 수행하지 않으며 일정한 비용이 듭니다.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Konwersje poszerzane i zdefiniowane przez użytkownika nie są obsługiwane w pr
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">Ciąg „AsSpan” jest bardziej wydajny niż ciąg „Substring”. Ciąg „Substring” wykonuje kopię ciągu O(n), natomiast ciąg „AsSpan” nie wykonuje i ponadto ma stały koszt.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">Ciąg „AsSpan” jest bardziej wydajny niż ciąg „Substring”. Ciąg „Substring” wykonuje kopię ciągu O(n), natomiast ciąg „AsSpan” nie wykonuje i ponadto ma stały koszt.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Ampliação e conversões definidas pelo usuário não são compatíveis com tip
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">'AsSpan' é mais eficiente do que 'Substring'. 'Substring' executa uma cópia de cadeia de caracteres O(n), enquanto 'AsSpan' não tem e tem um custo constante.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">'AsSpan' é mais eficiente do que 'Substring'. 'Substring' executa uma cópia de cadeia de caracteres O(n), enquanto 'AsSpan' não tem e tem um custo constante.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Widening and user defined conversions are not supported with generic types.</sou
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">"AsSpan" более эффективен, чем "Substring". "Substring" выполняет копирование строки O(n), тогда как "AsSpan" не имеет постоянных затрат.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">"AsSpan" более эффективен, чем "Substring". "Substring" выполняет копирование строки O(n), тогда как "AsSpan" не имеет постоянных затрат.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Genel türlerde genişletme ve kullanıcı tanımlı dönüştürmeler desteklen
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">'AsSpan', 'Substring'den daha verimlidir. 'Substring' bir O(n) dizesi kopyası oluşturur ama 'AsSpan' bunu yapmaz ve sabit bir maliyeti vardır.</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">'AsSpan', 'Substring'den daha verimlidir. 'Substring' bir O(n) dizesi kopyası oluşturur ama 'AsSpan' bunu yapmaz ve sabit bir maliyeti vardır.</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Enumerable.OfType&lt;T&gt; 使用的泛型类型检查 (C# 'is' operator/IL 'isi
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">“AsSpan” 比 “Substring” 效率更高。“Substring” 执行 O(n)字符串复制,而 “AsSpan” 不执行且具有固定成本。</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">“AsSpan” 比 “Substring” 效率更高。“Substring” 执行 O(n)字符串复制,而 “AsSpan” 不执行且具有固定成本。</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,8 +1919,8 @@ Enumerable.OfType&lt;T&gt; 使用的一般型別檢查 (C# 'is' operator/IL 'isi
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringDescription">
<source>'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="translated">'AsSpan' 比 'Substring' 更有效率。'Substring' 會執行 O(n) 字串複製,而 'AsSpan' 不會且有固定成本。</target>
<source>'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.</source>
<target state="needs-review-translation">'AsSpan' 比 'Substring' 更有效率。'Substring' 會執行 O(n) 字串複製,而 'AsSpan' 不會且有固定成本。</target>
<note />
</trans-unit>
<trans-unit id="PreferAsSpanOverSubstringMessage">
Expand Down
2 changes: 1 addition & 1 deletion src/NetAnalyzers/Microsoft.CodeAnalysis.NetAnalyzers.md
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ It is more efficient to use 'AsSpan' and 'string.Concat', instead of 'Substring'

## [CA1846](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1846): Prefer 'AsSpan' over 'Substring'

'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.
'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.

|Item|Value|
|-|-|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3032,7 +3032,7 @@
"CA1846": {
"id": "CA1846",
"shortDescription": "Prefer 'AsSpan' over 'Substring'",
"fullDescription": "'AsSpan' is more efficient then 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.",
"fullDescription": "'AsSpan' is more efficient than 'Substring'. 'Substring' performs an O(n) string copy, while 'AsSpan' does not and has a constant cost.",
"defaultLevel": "note",
"helpUri": "https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1846",
"properties": {
Expand Down