This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func AppendDataNaive(packet1 []byte, packet2 []byte) uint16 { | |
// Do some initial work done with packet1 and packet2... | |
// Don't set any capacity, let Go auto-resize | |
data := make([]byte, 0) | |
data = append(data, packet1...) | |
data = append(data, packet2...) | |
// Do some calculations with 'data' | |
return calculatedValue | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/Doc/CS56/lab2-DennisPing main ❯ make | |
+ cc cmdparse.c | |
cmdparse.c: In function ‘cmd_line_parse’: | |
cmdparse.c:387:40: error: implicit conversion from ‘tokentype_t’ to ‘controlop_t’ [-Werror=enum-conversion] | |
387 | cmd->controlop = token.type; | |
| ^ | |
cmdparse.c:392:40: error: implicit conversion from ‘tokentype_t’ to ‘controlop_t’ [-Werror=enum-conversion] | |
392 | cmd->controlop = token.type; | |
| ^ | |
cc1: all warnings being treated as errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tutorial by The Cherno on Youtube | |
// https://youtu.be/5HWCsmE9DrE | |
// Compile using | |
// g++ -std=c++17 fast.cpp -o fast | |
#include <vector> | |
#include <chrono> | |
#include <thread> | |
#include <future> |