lib/client/protobuf.js
function encodeArray(array, proto, offset, buffer, protos){
    let i = 0;

    if(util.isSimpleType(proto.type)){
      offset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));
      offset = writeBytes(buffer, offset, codec.encodeUInt32(array.length));
      for(i = 0; i < array.length; i++){
        offset = encodeProp(array[i], proto.type, offset, buffer);
      }
    }else{
      for(i = 0; i < array.length; i++){
        offset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));
        offset = encodeProp(array[i], proto.type, offset, buffer, protos);
      }
    }

    return offset;
  }
function encodeArray(array, proto, offset, buffer, protos){
    let i = 0;

    if(util.isSimpleType(proto.type)){
      offset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));
      offset = writeBytes(buffer, offset, codec.encodeUInt32(array.length));
      for(i = 0; i < array.length; i++){
        offset = encodeProp(array[i], proto.type, offset, buffer);
      }
    }else{
      for(i = 0; i < array.length; i++){
        offset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));
        offset = encodeProp(array[i], proto.type, offset, buffer, protos);
      }
    }

    return offset;
  }
function encodeArray ( array , proto , offset , buffer , protos ) { let i = 0 ; if ( util . isSimpleType ( proto . type ) ) { offset = writeBytes ( buffer , offset , encodeTag ( proto . type , proto . tag ) ) ; offset = writeBytes ( buffer , offset , codec . encodeUInt32 ( array . length ) ) ; for ( i = 0 ; i < array . length ; i ++ ) { offset = encodeProp ( array [ i ] , proto . type , offset , buffer ) ; } } else { for ( i = 0 ; i < array . length ; i ++ ) { offset = writeBytes ( buffer , offset , encodeTag ( proto . type , proto . tag ) ) ; offset = encodeProp ( array [ i ] , proto . type , offset , buffer , protos ) ; } } return offset ; }
Encode reapeated properties, simple msg and object are decode differented
Encode reapeated properties simple msg and object are decode differented