Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd903db3

Browse files
committed
faster shuffle()
1 parent0c36f5d commitd903db3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ signature has changed (now it has two optional boolean arguments: `ignore_spaces
8686
(it now makes use of the new extracted method`asciify()`)
8787
-`is_uuid()` has now a second parameter`allow_hex` that if true, considers as valid UUID hex value
8888
-`uuid()` has now an optional boolean parameter`as_hex` which allows to return UUID string as hex representation
89+
-`shuffle()` is now faster
8990

9091
---
9192

‎string_utils/manipulation.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def shuffle(input_string: str) -> str:
370370
raiseInvalidInputError(input_string)
371371

372372
# turn the string into a list of chars
373-
chars=sorted(input_string)
373+
chars=list(input_string)
374374

375375
# shuffle the list
376376
random.shuffle(chars)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp