app.Source/Sink/etc: Minor optimization.
app.Source/Sink/etc: Minor optimization.

Calculate how many packets can be processed, then do so with a
counting for loop. This is modestly faster than a while loop checking
for link full/empty (the original behavior).

For example, this old code:

    while not empty(i) and not full(o) do
       transfer(o, receive(i))
    end

becomes:

    for _ = 1, math.min(nreadable(i), nwritable(o)) do
       transfer(o, receive(i))
    end

andywingo/snabbswitch,eugeneia/snabb,xdel/snabbswitch,plajjan/snabbswitch,lukego/snabbswitch,heryii/snabb,dwdm/snabbswitch,kellabyte/snabbswitch,snabbnfv-goodies/snabbswitch,eugeneia/snabb,alexandergall/snabbswitch,eugeneia/snabb,xdel/snabbswitch,dpino/snabbswitch,dpino/snabb,SnabbCo/snabbswitch,kbara/snabb,eugeneia/snabb,lukego/snabbswitch,dpino/snabb,snabbco/snabb,justincormack/snabbswitch,eugeneia/snabbswitch,snabbco/snabb,dpino/snabbswitch,alexandergall/snabbswitch,dpino/snabb,plajjan/snabbswitch,virtualopensystems/snabbswitch,pirate/snabbswitch,Igalia/snabb,Igalia/snabb,alexandergall/snabbswitch,dwdm/snabbswitch,aperezdc/snabbswitch,mixflowtech/logsensor,fhanik/snabbswitch,kbara/snabb,dpino/snabb,fhanik/snabbswitch,dpino/snabb,wingo/snabbswitch,Igalia/snabb,Igalia/snabb,aperezdc/snabbswitch,andywingo/snabbswitch,plajjan/snabbswitch,snabbco/snabb,snabbnfv-goodies/snabbswitch,wingo/snabb,wingo/snabb,snabbnfv-goodies/snabbswitch,eugeneia/snabbswitch,wingo/snabb,andywingo/snabbswitch,heryii/snabb,kellabyte/snabbswitch,wingo/snabb,lukego/snabb,Igalia/snabbswitch,hb9cwp/snabbswitch,lukego/snabb,hb9cwp/snabbswitch,eugeneia/snabbswitch,kellabyte/snabbswitch,SnabbCo/snabbswitch,javierguerragiraldez/snabbswitch,snabbco/snabb,dpino/snabbswitch,eugeneia/snabb,virtualopensystems/snabbswitch,snabbco/snabb,pirate/snabbswitch,mixflowtech/logsensor,alexandergall/snabbswitch,Igalia/snabbswitch,Igalia/snabb,pavel-odintsov/snabbswitch,wingo/snabb,justincormack/snabbswitch,lukego/snabb,justincormack/snabbswitch,alexandergall/snabbswitch,kbara/snabb,snabbco/snabb,mixflowtech/logsensor,xdel/snabbswitch,lukego/snabbswitch,SnabbCo/snabbswitch,alexandergall/snabbswitch,fhanik/snabbswitch,virtualopensystems/snabbswitch,Igalia/snabb,snabbnfv-goodies/snabbswitch,Igalia/snabb,plajjan/snabbswitch,heryii/snabb,eugeneia/snabbswitch,pavel-odintsov/snabbswitch,eugeneia/snabb,dwdm/snabbswitch,dpino/snabbswitch,hb9cwp/snabbswitch,javierguerragiraldez/snabbswitch,alexandergall/snabbswitch,mixflowtech/logsensor,wingo/snabbswitch,heryii/snabb,eugeneia/snabb,andywingo/snabbswitch,wingo/snabbswitch,Igalia/snabbswitch,hb9cwp/snabbswitch,alexandergall/snabbswitch,lukego/snabbswitch,Igalia/snabbswitch,snabbco/snabb,pirate/snabbswitch,heryii/snabb,lukego/snabb,snabbco/snabb,mixflowtech/logsensor,javierguerragiraldez/snabbswitch,wingo/snabbswitch,SnabbCo/snabbswitch,eugeneia/snabb,dpino/snabb,pavel-odintsov/snabbswitch,dpino/snabb,wingo/snabb,kbara/snabb,Igalia/snabbswitch,aperezdc/snabbswitch,Igalia/snabb,aperezdc/snabbswitch,heryii/snabb,kbara/snabb,kbara/snabb,justincormack/snabbswitch