Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/common/common/utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void DateFormatter::parse(const std::string& format_string) {

std::string
DateFormatter::fromTimeAndPrepareSpecifierOffsets(time_t time, SpecifierOffsets& specifier_offsets,
const std::string& seconds_str) const {
const absl::string_view seconds_str) const {
std::string formatted_time;

int32_t previous = 0;
Expand Down Expand Up @@ -435,7 +435,7 @@ std::string StringUtil::subspan(absl::string_view source, size_t start, size_t e
return std::string(source.data() + start, end - start);
}

std::string StringUtil::escape(const std::string& source) {
std::string StringUtil::escape(const absl::string_view source) {
std::string ret;

// Prevent unnecessary allocation by allocating 2x original size.
Expand Down
4 changes: 2 additions & 2 deletions source/common/common/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DateFormatter {

using SpecifierOffsets = std::vector<int32_t>;
std::string fromTimeAndPrepareSpecifierOffsets(time_t time, SpecifierOffsets& specifier_offsets,
const std::string& seconds_str) const;
const absl::string_view seconds_str) const;

// A container to hold a specifiers (%f, %Nf, %s) found in a format string.
struct Specifier {
Expand Down Expand Up @@ -404,7 +404,7 @@ class StringUtil {
* @param source supplies the string to escape.
* @return escaped string.
*/
static std::string escape(const std::string& source);
static std::string escape(const absl::string_view source);

/**
* Outputs the string to the provided ostream, while escaping \n, \r, \t, and "
Expand Down