# Re: \[PATCH iproute2 net-next\] tc: m\_vlan: Add vlan modify action

- From: Shmulik Ladkani \<hidden\>
- Date: 2016-09-22 17:44:58 
- List: netdev
- Page: https://ratatoskr.run/netdev/2016/09/11030108
- Thread: https://ratatoskr.run/netdev/2016/09/11030053/t.md

```text
On Thu, 22 Sep 2016 09:05:04 -0700 Stephen Hemminger [ref] wrote:
> On Thu, 22 Sep 2016 12:31:10 +0300
> Shmulik Ladkani [ref] wrote:
> 
> > +
> > +static const char *action_name(int action)
> > +{
> > +	static const char * const names[] = {
> > +		[TCA_VLAN_ACT_POP] = "pop",
> > +		[TCA_VLAN_ACT_PUSH] = "push",
> > +		[TCA_VLAN_ACT_MODIFY] = "modify",
> > +	};
> > +	return names[action];
> > +}
> > +  
> 
> Why are you wrapping a simple array lookup in a function?

No reason in particular, was probably code evolution, will amend, thanks.
```
