mirror of
https://github.com/torarnv/sparsebundlefs.git
synced 2026-02-26 18:35:50 +01:00
Use const char foo[] over const char *foo for string literals
Saves one pointer in memory and is cleaner than const char * const.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
static const char *image_path = "/sparsebundle.dmg";
|
||||
static const char image_path[] = "/sparsebundle.dmg";
|
||||
|
||||
struct sparsebundle_data {
|
||||
char *path;
|
||||
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
|
||||
|
||||
string key, line;
|
||||
while (getline(plist_data, line)) {
|
||||
static const char *whitespace_chars = " \n\r\t";
|
||||
static const char whitespace_chars[] = " \n\r\t";
|
||||
line.erase(0, line.find_first_not_of(whitespace_chars));
|
||||
line.erase(line.find_last_not_of(whitespace_chars) + 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user