aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-17 12:47:01 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-17 12:47:01 -0700
commitd06d6c69645c4d355772cb19043469328c05ccc5 (patch)
treeba9f91943b94b9b59b3e781580eca5d3230ac493 /reader.cpp
parent977a4477f646e344e66a7b0bc22e2e89b72d20db (diff)
Various changes to reduce fish's compiled code size
OS X release build executable size dropped from 672k to 511k
Diffstat (limited to 'reader.cpp')
-rw-r--r--reader.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/reader.cpp b/reader.cpp
index 32bf33b2..74c519e6 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -306,6 +306,25 @@ class reader_data_t
/** Whether the a screen reset is needed after a repaint. */
bool screen_reset_needed;
+
+ /** Constructor */
+ reader_data_t() :
+ suppress_autosuggestion(0),
+ history(0),
+ token_history_pos(0),
+ search_pos(0),
+ buff_pos(0),
+ complete_func(0),
+ highlight_function(0),
+ test_func(0),
+ end_loop(0),
+ prev_end_loop(0),
+ next(0),
+ search_mode(0),
+ repaint_needed(0),
+ screen_reset_needed(0)
+ {
+ }
};
/**
@@ -530,8 +549,8 @@ void reader_data_t::command_line_changed() {
/** Remove any duplicate completions in the list. This relies on the list first beeing sorted. */
-static void remove_duplicates(std::vector<completion_t> &l) {
-
+static void remove_duplicates(std::vector<completion_t> &l)
+{
l.erase(std::unique( l.begin(), l.end()), l.end());
}
@@ -2100,9 +2119,7 @@ static int default_test( const wchar_t *b )
void reader_push( const wchar_t *name )
{
- // use something nasty which guarantees value initialization (that is, all fields zero)
- const reader_data_t zerod = {};
- reader_data_t *n = new reader_data_t(zerod);
+ reader_data_t *n = new reader_data_t();
n->history = & history_t::history_with_name(name);
n->app_name = name;