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

Fixed redundant boolean logic #7151

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

Conversation

@espinosa-dev
Copy link
Contributor

@espinosa-dev espinosa-dev commented Dec 5, 2025

This PR improves the toUpperCase method in strings/Upper.java by:

  1. Fixing a typo in the exception message ("connot" -> "cannot").
  2. Removing the redundant check Character.isLetter(currentChar). The method Character.isLowerCase(currentChar) implicitly checks if the character is a letter, making the explicit letter check unnecessary.
  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

Copy link

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.61%. Comparing base (bd7f269) to head (cc721a3).

Files with missing lines Patch % Lines
src/main/java/com/thealgorithms/strings/Upper.java 85.71% 1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## master #7151 +/- ##
============================================
- Coverage 78.62% 78.61% -0.01% 
+ Complexity 6824 6822 -2 
============================================
 Files 765 765 
 Lines 22599 22600 +1 
 Branches 4443 4443 
============================================
- Hits 17768 17767 -1 
- Misses 4117 4118 +1 
- Partials 714 715 +1 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DenizAltunkapan DenizAltunkapan merged commit 246162e into TheAlgorithms:master Dec 5, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@DenizAltunkapan DenizAltunkapan DenizAltunkapan approved these changes

@yanglbme yanglbme Awaiting requested review from yanglbme yanglbme is a code owner

@alxkm alxkm Awaiting requested review from alxkm alxkm is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /