Skip to content

Remove redundant includes from LedgerManagerImpl.cpp#5336

Open
anupsdf with Copilot wants to merge 2 commits into
masterfrom
copilot/remove-duplicate-includes
Open

Remove redundant includes from LedgerManagerImpl.cpp#5336
anupsdf with Copilot wants to merge 2 commits into
masterfrom
copilot/remove-duplicate-includes

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This change removes two redundant includes in src/ledger/LedgerManagerImpl.cpp: a duplicate XDR header include and a second self-include of LedgerManagerImpl.h. The goal is to keep the translation unit’s include list minimal and avoid unnecessary duplication.

  • Include cleanup

    • Remove the second xdr/Stellar-ledger-entries.h include.
    • Remove the later redundant LedgerManagerImpl.h include, which was already covered by the primary include at the top of the file.
  • Result

    • Preserves the existing include set required to build the file.
    • Reduces noise in a central ledger implementation file.
#include "work/WorkScheduler.h"
#include "xdr/Stellar-ledger-entries.h"

#ifdef BUILD_TESTS
#include "test/TxTests.h"
#endif
#include "xdr/Stellar-ledger.h"
#include "xdr/Stellar-transaction.h"
Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"Duplicate include directive detected. The header 'xdr/Stellar-ledger-entries.h' is included at both line 57 and line 65. Remove one of these duplicate includes to improve code maintainability.","fixFiles":[{"filePath":"src/ledger/LedgerManagerImpl.cpp","diff":"diff --git a/src/ledger/LedgerManagerImpl.cpp b/src/ledger/LedgerManagerImpl.cpp\n--- a/src/ledger/LedgerManagerImpl.cpp\n+++ b/src/ledger/LedgerManagerImpl.cpp\n@@ -62,7 +62,6 @@\n #ifdef BUILD_TESTS\n #include \"test/TxTests.h\"\n #endif\n-#include \"xdr/Stellar-ledger-entries.h\"\n #include \"xdr/Stellar-ledger.h\"\n #include \"xdr/Stellar-transaction.h\"\n #include \"xdrpp/types.h\"\n"}]},{"message":"The header 'LedgerManagerImpl.h' is included after all external headers and the primary include at line 5. This include is redundant since 'ledger/LedgerManagerImpl.h' was already included at line 5. Remove this duplicate include.","fixFiles":[{"filePath":"src/ledger/LedgerManagerImpl.cpp","diff":"diff --git a/src/ledger/LedgerManagerImpl.cpp b/src/ledger/LedgerManagerImpl.cpp\n--- a/src/ledger/LedgerManagerImpl.cpp\n+++ b/src/ledger/LedgerManagerImpl.cpp\n@@ -74,7 +74,6 @@\n #include \"medida/timer.h\"\n #include <Tracy.hpp>\n \n-#include \"LedgerManagerImpl.h\"\n #include <chrono>\n #include <future>\n #include <memory>\n"}]}]

Copilot AI changed the title [WIP] Fix duplicate include directives in LedgerManagerImpl.cpp Remove redundant includes from LedgerManagerImpl.cpp Jul 2, 2026
Copilot AI requested a review from anupsdf July 2, 2026 21:58
@anupsdf anupsdf marked this pull request as ready for review July 2, 2026 22:43
Copilot AI review requested due to automatic review settings July 2, 2026 22:43
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes duplicate #include directives in src/ledger/LedgerManagerImpl.cpp to keep the translation unit’s include list minimal and avoid redundant compilation work in a central ledger implementation file.

Changes:

  • Removed a duplicate #include "xdr/Stellar-ledger-entries.h" (the file still includes it once).
  • Removed a redundant self-include #include "LedgerManagerImpl.h" (the file already includes ledger/LedgerManagerImpl.h at the top).

@anupsdf anupsdf enabled auto-merge July 6, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants