You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by rr...@apache.org on 2019/04/23 11:03:20 UTC

[trafficserver] branch master updated: cppcheck: fix issue found in BufferWriterFormat.cc

This is an automated email from the ASF dual-hosted git repository.

rrm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new c438f94  cppcheck: fix issue found in BufferWriterFormat.cc
c438f94 is described below

commit c438f946077dc25e60f42c09bec098214f75cf18
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Tue Apr 23 16:37:00 2019 +0800

    cppcheck: fix issue found in BufferWriterFormat.cc
    
    Variable '_name' is assigned in constructor body. Consider performing initialization in initialization list.
---
 src/tscore/BufferWriterFormat.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/tscore/BufferWriterFormat.cc b/src/tscore/BufferWriterFormat.cc
index 70a5e01..05d821a 100644
--- a/src/tscore/BufferWriterFormat.cc
+++ b/src/tscore/BufferWriterFormat.cc
@@ -99,12 +99,11 @@ BWFSpec::Property::Property()
 }
 
 /// Parse a format specification.
-BWFSpec::BWFSpec(TextView fmt)
+BWFSpec::BWFSpec(TextView fmt) : _name(fmt.take_prefix_at(':'))
 {
   TextView num; // temporary for number parsing.
   intmax_t n;
 
-  _name = fmt.take_prefix_at(':');
   // if it's parsable as a number, treat it as an index.
   n = tv_to_positive_decimal(_name, &num);
   if (num.size()) {