Skip to content

Commit ae1ef68

Browse files
committed
Optimisation
Signed-off-by: JCW <[email protected]>
1 parent ee978f3 commit ae1ef68

File tree

3 files changed

+12
-38
lines changed

3 files changed

+12
-38
lines changed

include/xrpl/beast/utility/Journal.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,6 @@ operator<<(std::ostream& os, LogParameter<T> const& param);
7979

8080
namespace beast {
8181

82-
// Forward declaration for use in interfaces
83-
namespace detail {
84-
class SimpleJsonWriter;
85-
}
86-
87-
// Type alias for journal attribute factory functions
88-
using JournalAttributesFactory = void(detail::SimpleJsonWriter&);
89-
9082
namespace detail {
9183

9284
class SimpleJsonWriter

src/xrpld/app/main/Application.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -831,15 +831,6 @@ class ApplicationImp : public Application, public BasicApp
831831
bool
832832
serverOkay(std::string& reason) override;
833833

834-
beast::Journal
835-
journal(
836-
std::string const& name,
837-
std::function<beast::JournalAttributesFactory> const& attributes)
838-
override;
839-
840-
beast::Journal
841-
journal(std::string const& name) override;
842-
843834
//--------------------------------------------------------------------------
844835

845836
bool
@@ -2175,20 +2166,6 @@ ApplicationImp::serverOkay(std::string& reason)
21752166
return true;
21762167
}
21772168

2178-
beast::Journal
2179-
ApplicationImp::journal(
2180-
std::string const& name,
2181-
std::function<beast::JournalAttributesFactory> const& attributes)
2182-
{
2183-
return logs_->journal(name, std::move(attributes));
2184-
}
2185-
2186-
beast::Journal
2187-
ApplicationImp::journal(std::string const& name)
2188-
{
2189-
return logs_->journal(name);
2190-
}
2191-
21922169
void
21932170
ApplicationImp::setMaxDisallowedLedger()
21942171
{

src/xrpld/app/main/Application.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,18 @@ class Application : public beast::PropertyStream::Source
257257
virtual bool
258258
serverOkay(std::string& reason) = 0;
259259

260-
virtual beast::Journal
261-
journal(
262-
std::string const& name,
263-
std::function<beast::JournalAttributesFactory> const& attributes) = 0;
264-
265-
virtual beast::Journal
266-
journal(std::string const& name) = 0;
260+
template <typename TAttributesFactory>
261+
beast::Journal
262+
journal(std::string const& name, TAttributesFactory&& factory)
263+
{
264+
return logs().journal(name, std::forward<TAttributesFactory>(factory));
265+
}
266+
267+
beast::Journal
268+
journal(std::string const& name)
269+
{
270+
return logs().journal(name);
271+
}
267272

268273
/* Returns the number of file descriptors the application needs */
269274
virtual int

0 commit comments

Comments
 (0)