Changeset 173e2ce96a7bde630476defe34fae1b5ed1baaba

Show
Ignore:
Timestamp:
02/03/11 19:17:04 (16 months ago)
Author:
Antti-Juhani Kaijanaho <antti-juhani@…>
Children:
b4f0cdb42e637fd017a965937ff7dd3170eb55ac
Parents:
34bf9ca2b8b07128490ac650759c41566bb8d4a7
git-committer:
Antti-Juhani Kaijanaho <antti-juhani@…> (02/03/11 19:17:04)
Message:

#79: Kill tlate::msg_value precursor and followup lists if they are empty

Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>

Location:
tlate
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • tlate/basic_sequential_value.hh

    r868b365 r173e2ce  
    11/*  This file is part of Alue, the multiprotocol Internet discussion daemon 
    22 
    3     Copyright © 2009 Antti-Juhani Kaijanaho 
     3    Copyright © 2009, 2011 Antti-Juhani Kaijanaho 
    44 
    55    Alue is free software: you can redistribute it and/or modify it 
     
    6767 
    6868                Seq &operator*() { return seq; } 
     69                const Seq &operator*() const { return seq; } 
    6970                Seq *operator->() { return &seq; } 
     71                const Seq *operator->() const { return &seq; } 
    7072                Seq &get() { return seq; } 
     73                const Seq &get() const { return seq; } 
    7174 
    7275                virtual const_iterator begin() const { 
     
    8285        seqval(Seq seq, ValFac vf) 
    8386        { 
    84                 boost::shared_ptr<basic_sequential_value<Seq,ValFac> > rv 
    85                         (new basic_sequential_value<Seq,ValFac>(seq, vf)); 
     87                boost::shared_ptr<basic_sequential_value<Seq,ValFac> > rv; 
     88                if (seq.begin() != seq.end()) 
     89                        rv.reset(new basic_sequential_value<Seq,ValFac> 
     90                                 (seq, vf)); 
    8691                return rv; 
    8792        } 
  • tlate/list_value.hh

    r868b365 r173e2ce  
    11/*  This file is part of Alue, the multiprotocol Internet discussion daemon 
    22 
    3     Copyright © 2009 Antti-Juhani Kaijanaho 
     3    Copyright © 2009, 2011 Antti-Juhani Kaijanaho 
    44 
    55    Alue is free software: you can redistribute it and/or modify it 
     
    4242                        {} 
    4343                void push_back(value::const_ptr v) { get().push_back(v); } 
     44                bool empty() const { return get().empty(); } 
    4445        }; 
    4546} 
  • tlate/msg_value.cc

    r34bf9ca r173e2ce  
    195195                                ps->push_back(msg_value::mk(it, u)); 
    196196                        } 
    197                         rv = ps; 
     197                        if (!ps->empty()) rv = ps; 
    198198                } 
    199199                else if (rauthz && var == "thread")