Skip to content

Commit

Permalink
faster shuffle()
Browse files Browse the repository at this point in the history
  • Loading branch information
daveoncode committed Mar 4, 2020
1 parent 0c36f5d commit d903db3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ signature has changed (now it has two optional boolean arguments: `ignore_spaces
(it now makes use of the new extracted method `asciify()`)
- `is_uuid()` has now a second parameter `allow_hex` that if true, considers as valid UUID hex value
- `uuid()` has now an optional boolean parameter `as_hex` which allows to return UUID string as hex representation
- `shuffle()` is now faster

---

Expand Down
2 changes: 1 addition & 1 deletion string_utils/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def shuffle(input_string: str) -> str:
raise InvalidInputError(input_string)

# turn the string into a list of chars
chars = sorted(input_string)
chars = list(input_string)

# shuffle the list
random.shuffle(chars)
Expand Down

0 comments on commit d903db3

Please sign in to comment.