Fossil SCM

Slight optimization: Make two tables "static" that can be.

jan.nijtmans 2015-06-02 09:47 trunk
Commit 4440dae21237f861f08a5026c52a2ca44aff4ce3
1 file changed +4 -4
+4 -4
--- src/statrep.c
+++ src/statrep.c
@@ -673,11 +673,11 @@
673673
const char *zView = P("view"); /* Which view/report to show. */
674674
int eType = RPT_NONE; /* Numeric code for view/report to show */
675675
int i; /* Loop counter */
676676
const char *zUserName; /* Name of user */
677677
const char *azView[16]; /* Drop-down menu of view types */
678
- const struct {
678
+ static const struct {
679679
const char *zName; /* Name of view= screen type */
680680
const char *zVal; /* Value of view= query parameter */
681681
int eType; /* Corresponding RPT_* define */
682682
} aViewType[] = {
683683
{ "File Changes","byfile", RPT_BYFILE },
@@ -685,19 +685,19 @@
685685
{ "By User", "byuser", RPT_BYUSER },
686686
{ "By Week", "byweek", RPT_BYWEEK },
687687
{ "By Weekday", "byweekday", RPT_BYWEEKDAY },
688688
{ "By Year", "byyear", RPT_BYYEAR },
689689
};
690
- const char *const azType[] = {
690
+ static const char *const azType[] = {
691691
"a", "All Changes",
692692
"ci", "Check-ins",
693693
"g", "Tags",
694694
"e", "Tech Notes",
695695
"t", "Tickets",
696696
"w", "Wiki"
697697
};
698
-
698
+
699699
login_check_credentials();
700700
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
701701
zUserName = P("user");
702702
if( zUserName==0 ) zUserName = P("u");
703703
if( zUserName && zUserName[0]==0 ) zUserName = 0;
@@ -735,11 +735,11 @@
735735
}
736736
style_submenu_element("Stats", "Stats", "%R/stat");
737737
url_reset(&url);
738738
style_header("Activity Reports");
739739
switch( eType ){
740
- case RPT_BYYEAR:
740
+ case RPT_BYYEAR:
741741
stats_report_by_month_year(0, 0, zUserName);
742742
break;
743743
case RPT_BYMONTH:
744744
stats_report_by_month_year(1, 0, zUserName);
745745
break;
746746
--- src/statrep.c
+++ src/statrep.c
@@ -673,11 +673,11 @@
673 const char *zView = P("view"); /* Which view/report to show. */
674 int eType = RPT_NONE; /* Numeric code for view/report to show */
675 int i; /* Loop counter */
676 const char *zUserName; /* Name of user */
677 const char *azView[16]; /* Drop-down menu of view types */
678 const struct {
679 const char *zName; /* Name of view= screen type */
680 const char *zVal; /* Value of view= query parameter */
681 int eType; /* Corresponding RPT_* define */
682 } aViewType[] = {
683 { "File Changes","byfile", RPT_BYFILE },
@@ -685,19 +685,19 @@
685 { "By User", "byuser", RPT_BYUSER },
686 { "By Week", "byweek", RPT_BYWEEK },
687 { "By Weekday", "byweekday", RPT_BYWEEKDAY },
688 { "By Year", "byyear", RPT_BYYEAR },
689 };
690 const char *const azType[] = {
691 "a", "All Changes",
692 "ci", "Check-ins",
693 "g", "Tags",
694 "e", "Tech Notes",
695 "t", "Tickets",
696 "w", "Wiki"
697 };
698
699 login_check_credentials();
700 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
701 zUserName = P("user");
702 if( zUserName==0 ) zUserName = P("u");
703 if( zUserName && zUserName[0]==0 ) zUserName = 0;
@@ -735,11 +735,11 @@
735 }
736 style_submenu_element("Stats", "Stats", "%R/stat");
737 url_reset(&url);
738 style_header("Activity Reports");
739 switch( eType ){
740 case RPT_BYYEAR:
741 stats_report_by_month_year(0, 0, zUserName);
742 break;
743 case RPT_BYMONTH:
744 stats_report_by_month_year(1, 0, zUserName);
745 break;
746
--- src/statrep.c
+++ src/statrep.c
@@ -673,11 +673,11 @@
673 const char *zView = P("view"); /* Which view/report to show. */
674 int eType = RPT_NONE; /* Numeric code for view/report to show */
675 int i; /* Loop counter */
676 const char *zUserName; /* Name of user */
677 const char *azView[16]; /* Drop-down menu of view types */
678 static const struct {
679 const char *zName; /* Name of view= screen type */
680 const char *zVal; /* Value of view= query parameter */
681 int eType; /* Corresponding RPT_* define */
682 } aViewType[] = {
683 { "File Changes","byfile", RPT_BYFILE },
@@ -685,19 +685,19 @@
685 { "By User", "byuser", RPT_BYUSER },
686 { "By Week", "byweek", RPT_BYWEEK },
687 { "By Weekday", "byweekday", RPT_BYWEEKDAY },
688 { "By Year", "byyear", RPT_BYYEAR },
689 };
690 static const char *const azType[] = {
691 "a", "All Changes",
692 "ci", "Check-ins",
693 "g", "Tags",
694 "e", "Tech Notes",
695 "t", "Tickets",
696 "w", "Wiki"
697 };
698
699 login_check_credentials();
700 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
701 zUserName = P("user");
702 if( zUserName==0 ) zUserName = P("u");
703 if( zUserName && zUserName[0]==0 ) zUserName = 0;
@@ -735,11 +735,11 @@
735 }
736 style_submenu_element("Stats", "Stats", "%R/stat");
737 url_reset(&url);
738 style_header("Activity Reports");
739 switch( eType ){
740 case RPT_BYYEAR:
741 stats_report_by_month_year(0, 0, zUserName);
742 break;
743 case RPT_BYMONTH:
744 stats_report_by_month_year(1, 0, zUserName);
745 break;
746

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button