Skip to content

Commit

Permalink
commented unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Dec 15, 2022
1 parent a7a8dea commit 6d9f18c
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions include/orm/utils/container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ namespace Orm::Utils
static QString
join(const T &container, D &&delimiter = Constants::COMMA);

/*! Get a size of the greatest element in the container. */
template<QStringContainer T, typename SizeType = typename T::size_type>
static SizeType
maxElementSize(const T &container, typename T::size_type addToElement = 0);
// /*! Get a size of the greatest element in the container. */
// template<QStringContainer T, typename SizeType = typename T::size_type>
// static SizeType
// maxElementSize(const T &container, typename T::size_type addToElement = 0);

/*! Count all string sizes in the given container and optionally add value to
every string. */
Expand Down Expand Up @@ -64,30 +64,30 @@ namespace Orm::Utils
return columnized;
}

template<QStringContainer T, typename SizeType>
SizeType
Container::maxElementSize(const T &container,
const typename T::size_type addToElement)
{
// Nothing to do
if (container.empty())
return 0;

SizeType result = 0;

for (const auto &element : container)
if (const auto elementSize = element.size();
elementSize > result
)
result = elementSize;

/* This is the reason for the addToElement argument, this algorithm returns 0,
if the result is 0. */
if (result == 0)
return 0;

return result + addToElement;
}
// template<QStringContainer T, typename SizeType>
// SizeType
// Container::maxElementSize(const T &container,
// const typename T::size_type addToElement)
// {
// // Nothing to do
// if (container.empty())
// return 0;

// SizeType result = 0;

// for (const auto &element : container)
// if (const auto elementSize = element.size();
// elementSize > result
// )
// result = elementSize;

// /* This is the reason for the addToElement argument, this algorithm returns 0,
// if the result is 0. */
// if (result == 0)
// return 0;

// return result + addToElement;
// }

template<QStringContainer T, typename SizeType>
SizeType
Expand Down

0 comments on commit 6d9f18c

Please sign in to comment.