I've seen much more perf-murdering things being caused by
std::map<std::string, int> my_map;
for(const std::pair<std::string, int>& v: my_map) {
...
}
than with auto thoughIs it that iterating over map yields something other than `std::pair`, but which can be converted to `std::pair` (with nontrivial cost) and that result is bound by reference?
For the most part, installing packaged software simply extracts an archive to the filesystem, and you can uninstall using the standard method (apt remove, uv tool remove, ...).
Scripts are way less standardized. In this case it's not an argument about security, but about convenience and not messing up your system.
author me tions that git cli require multiple steps when there are unstaged changes.
I don't know if git has one liner cli command for it as i myself use gitextn to create worktrees
That's not really true in this case, as the worktree feature from jujutsu is not implemented on top of git worktrees.
It's more that there isn't really a big difference between the workflow of
# you're on
staging area
@ commit A
# make some untracked changes and console logs you don't wanna commit
git add -p && git commit # select only what you want
vs # you're on
@ empty commit
| commit A
# make some local changes (which are tracked in @)
jj commit -i # select only what you want
You're still "in charge what gets tracked" if you treat the last @ commit as your local playground, exactly the same as the staging area.
The only difference is that you can use exactly the same tools to manipulate your "staging area" as other commits.
The only difference being that you can manipulate your staging area with the same tools as any other commit. impl AsRef<str> for MyCoolString {
fn as_ref(&self) -> &str {
...
}
}
To be totally defensive, other library authors can write their APIs like fn my_cool_function(s: impl AsRef<str>) {
let s: &str = s.as_ref();
}
and now `s` is treated like any other &str. But even if library authors don't program defensively and use `s: &str` in the argument type, callers can always do this: my_cool_function(my_cool_string.as_ref());I think back to this in discussions about teaching. Abstract concepts are best understood when the student has a legitimate need for them. You can explain something all day and have their eyes glaze over wondering why something is important, but if it solves a problem they have it will click in seconds or minutes.
https://github.com/search?q=repo%3Alibjxl%2Fjxl-rs%20unsafe&...