From 2b03c109414097f92f8e42c8308b8699a6a6269c Mon Sep 17 00:00:00 2001 From: Ciaran Treanor Date: Thu, 29 Oct 2020 17:11:00 +0000 Subject: [PATCH] Correct small grammatical error in KDocs Updated KDoc generator template to address all instances of a grammatical error ("less" -> "fewer"). Also committed newly generate _Collections.kt, _Sequences.kt, and _Strings.kt. --- .../stdlib/common/src/generated/_Collections.kt | 8 ++++---- .../stdlib/common/src/generated/_Sequences.kt | 8 ++++---- .../stdlib/common/src/generated/_Strings.kt | 16 ++++++++-------- .../src/templates/Generators.kt | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/libraries/stdlib/common/src/generated/_Collections.kt b/libraries/stdlib/common/src/generated/_Collections.kt index 1816156f3a8..5ad7c4a5e41 100644 --- a/libraries/stdlib/common/src/generated/_Collections.kt +++ b/libraries/stdlib/common/src/generated/_Collections.kt @@ -2908,7 +2908,7 @@ public fun List.requireNoNulls(): List { /** * Splits this collection into a list of lists each not exceeding the given [size]. * - * The last list in the resulting list may have less elements than the given [size]. + * The last list in the resulting list may have fewer elements than the given [size]. * * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection. * @@ -2927,7 +2927,7 @@ public fun Iterable.chunked(size: Int): List> { * * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function. * You should not store it or allow it to escape in some way, unless you made a snapshot of it. - * The last list may have less elements than the given [size]. + * The last list may have fewer elements than the given [size]. * * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection. * @@ -3123,7 +3123,7 @@ public inline fun Collection.plusElement(element: T): List { * sliding along this collection with the given [step], where each * snapshot is a list. * - * Several last lists may have less elements than the given [size]. + * Several last lists may have fewer elements than the given [size]. * * Both [size] and [step] must be positive and can be greater than the number of elements in this collection. * @param size the number of elements to take in each window @@ -3163,7 +3163,7 @@ public fun Iterable.windowed(size: Int, step: Int = 1, partialWindows: Bo * * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function. * You should not store it or allow it to escape in some way, unless you made a snapshot of it. - * Several last lists may have less elements than the given [size]. + * Several last lists may have fewer elements than the given [size]. * * Both [size] and [step] must be positive and can be greater than the number of elements in this collection. * @param size the number of elements to take in each window diff --git a/libraries/stdlib/common/src/generated/_Sequences.kt b/libraries/stdlib/common/src/generated/_Sequences.kt index b1ccb2d1536..b002457d390 100644 --- a/libraries/stdlib/common/src/generated/_Sequences.kt +++ b/libraries/stdlib/common/src/generated/_Sequences.kt @@ -2352,7 +2352,7 @@ public fun Sequence.requireNoNulls(): Sequence { /** * Splits this sequence into a sequence of lists each not exceeding the given [size]. * - * The last list in the resulting sequence may have less elements than the given [size]. + * The last list in the resulting sequence may have fewer elements than the given [size]. * * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this sequence. * @@ -2373,7 +2373,7 @@ public fun Sequence.chunked(size: Int): Sequence> { * * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function. * You should not store it or allow it to escape in some way, unless you made a snapshot of it. - * The last list may have less elements than the given [size]. + * The last list may have fewer elements than the given [size]. * * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this sequence. * @@ -2559,7 +2559,7 @@ public inline fun Sequence.plusElement(element: T): Sequence { * sliding along this sequence with the given [step], where each * snapshot is a list. * - * Several last lists may have less elements than the given [size]. + * Several last lists may have fewer elements than the given [size]. * * Both [size] and [step] must be positive and can be greater than the number of elements in this sequence. * @param size the number of elements to take in each window @@ -2581,7 +2581,7 @@ public fun Sequence.windowed(size: Int, step: Int = 1, partialWindows: Bo * * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function. * You should not store it or allow it to escape in some way, unless you made a snapshot of it. - * Several last lists may have less elements than the given [size]. + * Several last lists may have fewer elements than the given [size]. * * Both [size] and [step] must be positive and can be greater than the number of elements in this sequence. * @param size the number of elements to take in each window diff --git a/libraries/stdlib/common/src/generated/_Strings.kt b/libraries/stdlib/common/src/generated/_Strings.kt index af555f2b813..90a0eee90f5 100644 --- a/libraries/stdlib/common/src/generated/_Strings.kt +++ b/libraries/stdlib/common/src/generated/_Strings.kt @@ -2081,7 +2081,7 @@ public inline fun CharSequence.sumOf(selector: (Char) -> ULong): ULong { /** * Splits this char sequence into a list of strings each not exceeding the given [size]. * - * The last string in the resulting list may have less characters than the given [size]. + * The last string in the resulting list may have fewer characters than the given [size]. * * @param size the number of elements to take in each string, must be positive and can be greater than the number of elements in this char sequence. * @@ -2100,7 +2100,7 @@ public fun CharSequence.chunked(size: Int): List { * * Note that the char sequence passed to the [transform] function is ephemeral and is valid only inside that function. * You should not store it or allow it to escape in some way, unless you made a snapshot of it. - * The last char sequence may have less characters than the given [size]. + * The last char sequence may have fewer characters than the given [size]. * * @param size the number of elements to take in each char sequence, must be positive and can be greater than the number of elements in this char sequence. * @@ -2114,7 +2114,7 @@ public fun CharSequence.chunked(size: Int, transform: (CharSequence) -> R): /** * Splits this char sequence into a sequence of strings each not exceeding the given [size]. * - * The last string in the resulting sequence may have less characters than the given [size]. + * The last string in the resulting sequence may have fewer characters than the given [size]. * * @param size the number of elements to take in each string, must be positive and can be greater than the number of elements in this char sequence. * @@ -2133,7 +2133,7 @@ public fun CharSequence.chunkedSequence(size: Int): Sequence { * * Note that the char sequence passed to the [transform] function is ephemeral and is valid only inside that function. * You should not store it or allow it to escape in some way, unless you made a snapshot of it. - * The last char sequence may have less characters than the given [size]. + * The last char sequence may have fewer characters than the given [size]. * * @param size the number of elements to take in each char sequence, must be positive and can be greater than the number of elements in this char sequence. * @@ -2189,7 +2189,7 @@ public inline fun String.partition(predicate: (Char) -> Boolean): Pair CharSequence.windowed(size: Int, step: Int = 1, partialWindows: B * sliding along this char sequence with the given [step], where each * snapshot is a string. * - * Several last strings may have less characters than the given [size]. + * Several last strings may have fewer characters than the given [size]. * * Both [size] and [step] must be positive and can be greater than the number of elements in this char sequence. * @param size the number of elements to take in each window @@ -2264,7 +2264,7 @@ public fun CharSequence.windowedSequence(size: Int, step: Int = 1, partialWindow * * Note that the char sequence passed to the [transform] function is ephemeral and is valid only inside that function. * You should not store it or allow it to escape in some way, unless you made a snapshot of it. - * Several last char sequences may have less characters than the given [size]. + * Several last char sequences may have fewer characters than the given [size]. * * Both [size] and [step] must be positive and can be greater than the number of elements in this char sequence. * @param size the number of elements to take in each window diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt index 9826eafe482..7287b41a336 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt @@ -642,7 +642,7 @@ object Generators : TemplateGroupBase() { Note that the ${f.viewResult} passed to the [transform] function is ephemeral and is valid only inside that function. You should not store it or allow it to escape in some way, unless you made a snapshot of it. - Several last ${f.viewResult.pluralize()} may have less ${f.element.pluralize()} than the given [size]. + Several last ${f.viewResult.pluralize()} may have fewer ${f.element.pluralize()} than the given [size]. Both [size] and [step] must be positive and can be greater than the number of elements in this ${f.collection}. @param size the number of elements to take in each window @@ -724,7 +724,7 @@ object Generators : TemplateGroupBase() { sliding along this ${f.collection} with the given [step], where each snapshot is ${f.snapshotResult.prefixWithArticle()}. - Several last ${f.snapshotResult.pluralize()} may have less ${f.element.pluralize()} than the given [size]. + Several last ${f.snapshotResult.pluralize()} may have fewer ${f.element.pluralize()} than the given [size]. Both [size] and [step] must be positive and can be greater than the number of elements in this ${f.collection}. @param size the number of elements to take in each window @@ -778,7 +778,7 @@ object Generators : TemplateGroupBase() { Note that the ${f.viewResult} passed to the [transform] function is ephemeral and is valid only inside that function. You should not store it or allow it to escape in some way, unless you made a snapshot of it. - Several last ${f.viewResult.pluralize()} may have less ${f.element.pluralize()} than the given [size]. + Several last ${f.viewResult.pluralize()} may have fewer ${f.element.pluralize()} than the given [size]. Both [size] and [step] must be positive and can be greater than the number of elements in this ${f.collection}. @param size the number of elements to take in each window @@ -814,7 +814,7 @@ object Generators : TemplateGroupBase() { sliding along this ${f.collection} with the given [step], where each snapshot is ${f.snapshotResult.prefixWithArticle()}. - Several last ${f.snapshotResult.pluralize()} may have less ${f.element.pluralize()} than the given [size]. + Several last ${f.snapshotResult.pluralize()} may have fewer ${f.element.pluralize()} than the given [size]. Both [size] and [step] must be positive and can be greater than the number of elements in this ${f.collection}. @param size the number of elements to take in each window @@ -842,7 +842,7 @@ object Generators : TemplateGroupBase() { Note that the ${f.viewResult} passed to the [transform] function is ephemeral and is valid only inside that function. You should not store it or allow it to escape in some way, unless you made a snapshot of it. - The last ${f.viewResult} may have less ${f.element.pluralize()} than the given [size]. + The last ${f.viewResult} may have fewer ${f.element.pluralize()} than the given [size]. @param size the number of elements to take in each ${f.viewResult}, must be positive and can be greater than the number of elements in this ${f.collection}. """ @@ -869,7 +869,7 @@ object Generators : TemplateGroupBase() { """ Splits this ${f.collection} into a ${f.mapResult} of ${f.snapshotResult.pluralize()} each not exceeding the given [size]. - The last ${f.snapshotResult} in the resulting ${f.mapResult} may have less ${f.element.pluralize()} than the given [size]. + The last ${f.snapshotResult} in the resulting ${f.mapResult} may have fewer ${f.element.pluralize()} than the given [size]. @param size the number of elements to take in each ${f.snapshotResult}, must be positive and can be greater than the number of elements in this ${f.collection}. """ @@ -898,7 +898,7 @@ object Generators : TemplateGroupBase() { Note that the ${f.viewResult} passed to the [transform] function is ephemeral and is valid only inside that function. You should not store it or allow it to escape in some way, unless you made a snapshot of it. - The last ${f.viewResult} may have less ${f.element.pluralize()} than the given [size]. + The last ${f.viewResult} may have fewer ${f.element.pluralize()} than the given [size]. @param size the number of elements to take in each ${f.viewResult}, must be positive and can be greater than the number of elements in this ${f.collection}. """ @@ -923,7 +923,7 @@ object Generators : TemplateGroupBase() { """ Splits this ${f.collection} into a sequence of ${f.snapshotResult.pluralize()} each not exceeding the given [size]. - The last ${f.snapshotResult} in the resulting sequence may have less ${f.element.pluralize()} than the given [size]. + The last ${f.snapshotResult} in the resulting sequence may have fewer ${f.element.pluralize()} than the given [size]. @param size the number of elements to take in each ${f.snapshotResult}, must be positive and can be greater than the number of elements in this ${f.collection}. """