gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] /srv/bzr/gnash/trunk r11344: Use HTML attribute map i


From: Benjamin Wolsey
Subject: Re: [Gnash-commit] /srv/bzr/gnash/trunk r11344: Use HTML attribute map iterator to reference attribute.
Date: Thu, 30 Jul 2009 20:19:58 +0200

>  void
> +TextField::setRestrict(std::string restrict)
> +{

It's generally advisable to pass std::strings by ref-to-const to avoid
unnecessary copies.

> +    std::set<char>::const_iterator locate;

It might be useful to use a typedef for _restrictedchars. If you decide
to change it later, you don't have to alter as much code. It would be
worth checking whether non-ascii characters such as 'รค' can be part of
restrict, as they require a wider type than char.


> +     std::string getRestrict() const
> +     {
> +             return _restrict;
> +     }

Could also be returned by ref-to-const. It's up to the caller then
whether to create a copy or not.

bwy

--
Free Flash, use Gnash
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]