in scrooge-core/src/main/scala/com/twitter/scrooge/internal/TProtocols.scala [175:216]
def writeListI64(
protocol: TProtocol,
list: collection.Seq[Long]
): Unit = {
list match {
case wrappedArray: mutable.WrappedArray.ofLong =>
val arr = wrappedArray.array
val len = arr.length
protocol.writeListBegin(new TList(typeForCollection(TType.I64), len))
var i = 0
while (i < len) {
protocol.writeI64(arr(i))
i += 1
}
protocol.writeListEnd()
case arrayBuffer: ArrayBuffer[Long] =>
val len = arrayBuffer.length
protocol.writeListBegin(new TList(typeForCollection(TType.I64), len))
var i = 0
while (i < len) {
protocol.writeI64(arrayBuffer(i))
i += 1
}
protocol.writeListEnd()
case _: IndexedSeq[_] =>
val len = list.length
protocol.writeListBegin(new TList(typeForCollection(TType.I64), len))
var i = 0
while (i < len) {
protocol.writeI64(list(i))
i += 1
}
protocol.writeListEnd()
case _ =>
val len = list.length
protocol.writeListBegin(new TList(typeForCollection(TType.I64), len))
list.foreach { element =>
protocol.writeI64(element)
}
protocol.writeListEnd()
}
}