Commits

Anonymous committed 5f3a3a0

remove duplicate logic (call riak_util:compare_dates/2, instead of copying here)

Comments (0)

Files changed (1)

src/riak_object.erl

 
 compare_content_dates(C1,C2) ->
     % true if C1 was modifed later than C2
-    A1 = calendar:datetime_to_gregorian_seconds(
-	   httpd_util:convert_request_date(
-             dict:fetch(<<"X-Riak-Last-Modified">>, C1#r_content.metadata))),
-    B1 = calendar:datetime_to_gregorian_seconds(
-	   httpd_util:convert_request_date(
-             dict:fetch(<<"X-Riak-Last-Modified">>, C2#r_content.metadata))),
-    A1 > B1.
+    riak_util:compare_dates(
+      dict:fetch(<<"X-Riak-Last-Modified">>, C1#r_content.metadata),
+      dict:fetch(<<"X-Riak-Last-Modified">>, C2#r_content.metadata)).
 
 %% @spec merge(riak_object(), riak_object()) -> riak_object()
 %% @doc  Merge the contents and vclocks of OldObject and NewObject.