Open
Conversation
Comment on lines
-10
to
+12
| text += '// fast_float by ' + line | ||
| text += f'// fast_float by {line}' | ||
| if filename == 'CONTRIBUTORS': | ||
| text += '// with contributions from ' + line | ||
| text += f'// with contributions from {line}' |
Author
There was a problem hiding this comment.
Lines 10-41 refactored with the following changes:
- Use f-string instead of string concatenation [×4] (
use-fstring-for-concatenation) - Use str.join() instead of for loop [×2] (
use-join) - Lift code into else after jump in control flow (
reintroduce-else) - Remove redundant continue statement (
remove-redundant-continue)
Comment on lines
-65
to
+67
| result.append('// MIT License Notice\n//\n') | ||
| result.append(processed_files['LICENSE-MIT']) | ||
| result.append('//\n') | ||
| result.extend(('// MIT License Notice\n//\n', | ||
| processed_files['LICENSE-MIT'], '//\n')) | ||
| if license_arg in ('DUAL', 'APACHE'): | ||
| result.append('// Apache License (Version 2.0) Notice\n//\n') | ||
| result.append(processed_files['LICENSE-APACHE']) | ||
| result.append('//\n') | ||
|
|
||
| result.extend(( | ||
| '// Apache License (Version 2.0) Notice\n//\n', | ||
| processed_files['LICENSE-APACHE'], | ||
| '//\n', | ||
| )) |
Author
There was a problem hiding this comment.
Function license_content refactored with the following changes:
- Merge consecutive list appends into a single extend [×4] (
merge-list-appends-into-extend)
Comment on lines
-6
to
+7
| while((1<<y) < x): | ||
| y = y + 1 | ||
| while ((1<<y) < x): | ||
| y += 1 |
Author
There was a problem hiding this comment.
Function log2 refactored with the following changes:
- Replace assignment with augmented assignment (
aug-assign)
Comment on lines
-67
to
-73
| for j, tq in enumerate(all_tqs): | ||
| for tq in all_tqs: | ||
| for _, w in convergents(continued_fraction(tq, 2**137)): | ||
| if w >= 2**64: | ||
| break | ||
| if (tq*w) % 2**137 > 2**137 - 2**64: | ||
| print(f"SOLUTION: q={j-342} T[q]={tq} w={w}") | ||
| found_solution = True |
Author
There was a problem hiding this comment.
Lines 67-73 refactored with the following changes:
- Remove unnecessary calls to
enumeratewhen the index is not used (remove-unused-enumerate) - Remove unreachable code (
remove-unreachable-code)
| upper = number // (1<<64) | ||
| lower = number % (1<<64) | ||
| print(""+hex(upper)+","+hex(lower)+",") | ||
| print(f"{hex(upper)},{hex(lower)},") |
Author
There was a problem hiding this comment.
Function format refactored with the following changes:
- Use f-string instead of string concatenation [×4] (
use-fstring-for-concatenation)
Comment on lines
-11
to
+20
| if(q >= -27): | ||
| if (q >= -27): | ||
| b = z + 127 | ||
| c = 2 ** b // power5 + 1 | ||
| format(c) | ||
| else: | ||
| b = 2 * z + 2 * 64 | ||
| c = 2 ** b // power5 + 1 | ||
| # truncate | ||
| while(c >= (1<<128)): | ||
| c //= 2 | ||
| format(c) | ||
|
|
||
| format(c) |
Author
There was a problem hiding this comment.
Lines 11-22 refactored with the following changes:
- Hoist repeated code outside conditional statement (
hoist-statement-from-if)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch
mainrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
mainbranch, then run:Help us improve this pull request!