summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorLeonetienne <leonetienne@hotmail.de>2022-02-10 05:34:07 +0100
committerLeonetienne <leonetienne@hotmail.de>2022-02-10 05:34:07 +0100
commitba5f0cbd9468e4c0d126c4ab199844576e0121df (patch)
tree7c41d366eb05dbf6f0da6394fc285d8664cc29bd /main.cpp
parente9b5c29b35fda84af83803131515994865e2cb4e (diff)
Impwuvd piping behaviour
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 4afe084..da09e17 100644
--- a/main.cpp
+++ b/main.cpp
@@ -29,7 +29,6 @@ bool IsLetter(const char c) {
return (lowercase_c >= 'a') && (lowercase_c <= 'z');
}
-
//! Checks whether or not `c` is an uppercase character
bool IsUpper(const char c) {
if (!IsLetter(c))
@@ -339,9 +338,13 @@ int main(int argc, char** argv) {
// Else, be prepared to get __piped__
else
{
+ // We're better off processing all in one go, as to not re-seed the PRNG for every single line...
std::string buf;
+ std::stringstream ss;
while (std::getline(std::cin, buf))
- std::cout << MakeUwu(buf) << std::endl;
+ ss << buf << std::endl;
+
+ std::cout << MakeUwu(ss.str()) << std::endl;
}
return 0;